The CreatorCon Call for Content is officially open! Get started here.

Assigning incident to specific assignment group based on category

gnunez
Kilo Guru

Hello all,

I created a record producer with 2 categories (Project, Software) and a couple of subcategories. The request is that if a certain category "Project" or its corresponding subcategories is selected then it should be assigned to assignment group "ABC", else it should be assigned to group "123".

I had included a line of script when it was only assigned to one person, but now that this requirement came up it no longer works. Is there a line of script I can add to separate the two, possibly an else statement?

Below is what currently is in place:

find_real_file.png

**We are on Istanbul

Thanks in advance!

Grace

1 ACCEPTED SOLUTION

Your script shud be like below


if(current.category == 'inquiry' && (current.subcategory == 'antivirus' || current.subcategory == 'email'))


{


current.assignment_group = 'b85d44954a3623120004689b2d5dd60a';


}


else if(current.category == 'software' && current.subcategory == 'os')


{


current.assignment_group = 'aaccc971c0a8001500fe1ff4302de101';


}


Regards
Harish

View solution in original post

7 REPLIES 7

Your script shud be like below


if(current.category == 'inquiry' && (current.subcategory == 'antivirus' || current.subcategory == 'email'))


{


current.assignment_group = 'b85d44954a3623120004689b2d5dd60a';


}


else if(current.category == 'software' && current.subcategory == 'os')


{


current.assignment_group = 'aaccc971c0a8001500fe1ff4302de101';


}


Regards
Harish

Thank you Harish for all your help, it is working!


Dave Smith1
ServiceNow Employee
ServiceNow Employee

Thank you Harish for all your help, it is working!


.. but it's an unmaintainable solution, sadly.



As paablo mentioned, Assignment Lookup Rules is a safer approach, and require no scripting.