- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2019 10:38 AM
Hi All,
We have a requirement to trigger a notification on assignment group change where the group name contains test. Let me know how I can achieve this.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2019 12:20 PM
Hi,
You can add When to run condition as,
Assignement group -> changes
In the script, write
(function executeRule(current, previous /*null when async*/) {
if(previous.assignment_group.indexOf('XYZ')>-1)
{
gs.eventQueue('eventname',obj,parm1, parm2);
}
}
I would say go with After business rule because 'previous' object won't work in Asynch business rule and Before BR will force user to wait until notification triggers.
Let me know if you need more help.
Mark it as correct or helpful if it helps.
Thanks,
Abhijit Chillal
Regards,
Abhijit
ServiceNow MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2019 12:00 PM
Go to the Event Registry, and register an event that triggers the notification. Once this is done, create an after update business rule that triggers the event.
gs.eventQueue('nameofyourevent',obj(this is the object being targeted, is usually 'current',parm1, parm2);
parm1 and parm2 are variables that can be passed in. Usernames, email addresses of notification recipients, etc. can be passed in and accessed in notification here.