- 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 10:43 AM
you can create notification that is fired by event and use business rule to fire that event
EX:
gs.eventQueue('x_58872_needit.overdueNeedItTask',current,current.number,gs.getUserName());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2019 10:45 AM
Hi,
You can create an after update business rule and trigger event.
When to run --> Assignment group -- changes and assignment group --contains -- test
What to run -->
gs.eventQueue('eventname',obj,parm1, parm2);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2019 10:51 AM
I need to trigger this only when the assignment group is changed from contains XYZ and changes to certain groups
- 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