Assignment rules not working when using script tab to configure them

PriyanshuVerma1
Tera Expert

Hey, i wrote some assignment rules but discovered that they are case sensitive. So i thought of using the script tab to convert short description entered by user into lower case and they use "contains" to find key words.  

But only one assignment rule is triggering every time which has the lowest order. It is not reading the conditions.

But if switch back to using condition builder in "applies to" tab the assignment rules start working fine.

Here is the script i am using in assignment rules

if(current.short_description.toLowerCase().indexOf('coupa')>-1){
current.assignment_group.setDisplayValue("Service desk");
}

 

2 REPLIES 2

Satishkumar B
Giga Sage
Giga Sage

Hi @PriyanshuVerma1 

Your script should work for setting the assignment group based on the keyword in the short description. Ensure:

  1. The assignment rule has the correct priority
  2. The assignment group name matches exactly.
  3. Add logging for debugging and verify the system logs for issues.

 

Please mark my response as helpful/accept the solution if it helps

The assignment rules are not working as expected. First the big issue is that they are case senistive. On using script  I don't know why only the assignment rule with lowest priority is triggering. Others don't seem to run at all.

Is there better alternative than assignment rules?