- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 03:42 AM
Hi community!
we are currently using a custom table (say test table) that extends task table and when certain conditions are met, there will be a group approval record created for our test table record and when any user in the group approves it, the other approvals will be set to no longer required. now, our new requirement is that when any of the user in this group approves or rejects the task, then there should be an email sent for the users.
How to configure this notification? I was thinking of creating notification on sysapproval_approver table when source table is test table and approval record state changes to approved or rejected, then the group will be receiving notifications but problem with this is that how do I set the approver name dynamically in the email body?
(This mail should be sent to all the users in the group, say user1, user2, user3 and in the email body there should be something like dear user1, dear user2... How do I set these user names in body dynamically?)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 05:53 AM
It seems you are close to getting the solution you need.
I think you should use an email script for what you want.
Take a look at this out of the box example: /sys_script_email.do?sys_id=65451214532310101553ddeeff7b128d
Then you call that email script from you notification body with ${mail_script:<your script>}
If I helped you with your case, please click the Thumb Icon and mark as Correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 06:37 AM
@Tanya Manoj For adding Approver name to email body you can use Approver field of "sysapproval_approver" table as below
Create an event
We will use gs.eventQueue() function to send notification to each user.
And you can add following script to the business rule
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 05:53 AM
It seems you are close to getting the solution you need.
I think you should use an email script for what you want.
Take a look at this out of the box example: /sys_script_email.do?sys_id=65451214532310101553ddeeff7b128d
Then you call that email script from you notification body with ${mail_script:<your script>}
If I helped you with your case, please click the Thumb Icon and mark as Correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 06:37 AM
@Tanya Manoj For adding Approver name to email body you can use Approver field of "sysapproval_approver" table as below
Create an event
We will use gs.eventQueue() function to send notification to each user.
And you can add following script to the business rule
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 06:45 AM
Thanks @Sebas Di Loreto & @jaheerhattiwale ,
I have done it using mail scripts and the other solution worked for me too.
Thanks for helping!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 06:46 AM
👍
ServiceNow Community Rising Star, Class of 2023