
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 05:10 AM
I have a Notification record on the incident table:
I want to script the recipient list "Who will receive".
How can I script the recipient list?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 05:20 AM
I believe you would have to change send when drop down to an event is triggered. An then use a business rule to trigger the event and then on the who will receive there should be a check box "Event parm 1 contains recipient". Then and determine in you business rule who will get it and use gs.eventQueue to fire the event.
gs.eventQueue('Event Name', current, list of recipients);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 05:13 AM
You can add a script to your message body with the tag:
${mail_script:scriptname}
See this for more information
Scripting for email notifications | ServiceNow Docs
The scripting API includes an email object that you can several methods described here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 05:14 AM
Hello,
Trigger the notification through an event instead.
Then you can send the recipients as a parameter and script them in the script that triggers the event.
https://community.servicenow.com/community?id=community_article&sys_id=054deee5dbd0dbc01dcaf3231f961912
Either add the recipients in a Mail Script, or have one of the Event Parms having a comma separated list of recipients and set that parameter in your Notification to contain recipients.
With regards
Anton

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 05:20 AM
I believe you would have to change send when drop down to an event is triggered. An then use a business rule to trigger the event and then on the who will receive there should be a check box "Event parm 1 contains recipient". Then and determine in you business rule who will get it and use gs.eventQueue to fire the event.
gs.eventQueue('Event Name', current, list of recipients);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 06:05 AM
That "event" doc link is incredibly confusing because if you follow the steps, nothing works. That article certainly needs QA'd. I'll muddle through and try to find examples.
I'm confident this is the route I need to take, but to find decent documentation will take a bit longer. 😉