Based on service Assignment group should populate by using assignment rule.

srikavya kondet
Tera Contributor

When we raise a case ticket , based on service assignment group should populate. For this i have written a script.

 

var val = '';
var itSuppGrp = new GlideRecord('sys_user_group');
itSuppGrp.addQuery('name','IT Support');
itSuppGrp.query();
if(itSuppGrp.next()){
val =itSuppGrp.sys_id;
}
if (current.business_service.support_group == ""){
current.assignment_group = val;
}
else {
current.assignment_group = current.business_service.support_group;
}

 

This script is working fine but if service changes assignment group should also change. But it is not working. Please provide a ASSIGNMENT RULE script for this.

9 REPLIES 9

Kieran Anson
Kilo Patron

Assignment rules won't run if the assignment group is already populated. You're going to want to do this either in an onChange client script, or an update business rule

Hi Kieran Anson, Thank you...

I'm more than happy to aid in existing logic that isn't working as expected, but I'm not here to write the logic for you. Have a go at working the solution out for yourself and grow your knowledge of the NOW platform

Mark Manders
Mega Patron

Assignment rules only run when the field is empty, so if it is already set, they won't trigger again. You can't resolve this with an assignment rule. There are two possible solution: create a script to run onChange of the field (either a client script or a business rule) to set the correct value either client side or before the record is saved to the server. Or create a client script onChange of the service to empty the assignment group field so the assignment rule runs again when the record is saved.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark