Assignment Rule Script with conditions to set Assignment Group and Assigned to

rishabh31
Mega Sage

Team,

 

Struggling to auto set assignment group and assign to on sc_req_item table.

 

Condition:

if , catalog item is 'Request'; checkbox variables - 'user_access_management' and 'sap' must be 'true'; Department of RITM 'Opened by' should be 'Finance & Accounting'

then RITM's assignment group assigned to 'Group X' and assigned to 'User X1' (Note: User X1 is a member of Group X)

 

else if 

catalog item is 'Request'; checkbox variables - 'check_userguide' and 'suite' must be 'true'; Department of RITM 'Opened by' should be 'Quality'

then RITM's assignment group assigned to 'Group Y' and assigned to 'User Y1' (Note: User Y1 is a member of Group Y)

 

To achieve this I have wrote below script on assignment rule 

if (current.cat_item == "Request" && current.variables.user_access_management == true && current.variables.sap == true && current.opened_by.department.name == "Finance & Accounting")
//current.setValue("assignment_group","b99151b31bb59d10a9714159cc4bcb77");  //sys_id of Group X
current.assignment_group.setDisplayValue("Group X");
current.assigned_to.setDisplayValue("User X1");

else if (current.cat_item == "Request" && current.variables.check_userguide == true && current.variables.suite == true && current.opened_by.department.name == "Quality")
//current.setValue("assignment_group","efc122b31bb59d10a9714159cc4b21c7");  //sys_id of Group Y
current.assignment_group.setDisplayValue("Group Y");
current.assigned_to.setDisplayValue("User Y1");

but it is not working as neither assignment group nor assigned to is auto setting.

 

Please help with the script

5 REPLIES 5

@Unique45 could you please help with gs.info() and where to place it to debug