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

Mike Patel
Tera Sage

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());

https://developer.servicenow.com/app.do#!/lp/new_to_servicenow/app_store_learnv2_automatingapps_madr...

amaradiswamy
Kilo Sage

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);

I need to trigger this only when the assignment group is changed from contains XYZ and changes to certain groups

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