Assignment rule with variable condition (sc_task)

demianmu_oz
Kilo Contributor

Hello;

I created an assignment rule where the condition is depends of the a a variable of the service, but when I try the service, the rule don ´t work.

Rule.png

There is another way to configure an assignment rule where depends of a variable field

1 ACCEPTED SOLUTION

VaranAwesomenow
Mega Sage

I had the exact same issue, so I soultioned it a little differently by making use of the script option in the assignment rule.


In the assignment rule condition I just gave the catalog item to which it applies



find_real_file.png


I made use of script to identify the assignment group


find_real_file.png


script



if(current.request_item.variable_pool.Test == 'test1') {


current.assignment_group.setDisplayValue("HR Support");


}


else {


if(current.request_item.variable_pool.Test == 'test2') {


current.assignment_group.setDisplayValue("Service Desk");


}


}



The variable (Test) I used has 2 choices


test1 and test2


If I select test1 then assignment group = HR Support


if I select test2 then assignment group = Service Desk



I made a screencast of the changes made and demo of the functionality please follow below link to view it.



ServicenowAssignmentRuleCatalogTask - YouTube


View solution in original post

4 REPLIES 4

VaranAwesomenow
Mega Sage

I had the exact same issue, so I soultioned it a little differently by making use of the script option in the assignment rule.


In the assignment rule condition I just gave the catalog item to which it applies



find_real_file.png


I made use of script to identify the assignment group


find_real_file.png


script



if(current.request_item.variable_pool.Test == 'test1') {


current.assignment_group.setDisplayValue("HR Support");


}


else {


if(current.request_item.variable_pool.Test == 'test2') {


current.assignment_group.setDisplayValue("Service Desk");


}


}



The variable (Test) I used has 2 choices


test1 and test2


If I select test1 then assignment group = HR Support


if I select test2 then assignment group = Service Desk



I made a screencast of the changes made and demo of the functionality please follow below link to view it.



ServicenowAssignmentRuleCatalogTask - YouTube


Hi Anil:



Excellent!!! I created the script and it work fine.



thanks a lot for your help.



regards!


Andy van Steijn
Tera Contributor

Yes confirmed this work around. Hope that SN will fix this bug. Would be more logical if you could select the condition