Trigger notification based on assignment group change

SNow35
Giga Guru

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.

1 ACCEPTED SOLUTION

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

 

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP

View solution in original post

5 REPLIES 5

Brandon Barret1
Mega Sage

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.