Scripting for UI Policy - assignment group

Mariem
Tera Contributor

Hello community😃,

 

I am trying to create a script for UI policy that says "if the variable [subject] contains certain words like (help, emergency..) this should be assigned directly to the assignment group [x]". How could I script this?

 

Waiting for your comments

 

 

Thanks a lot

Mariem

4 REPLIES 4

Rahul RJ
Giga Sage
Giga Sage

Hi Mariem,

You can try below code 

Ui policy - When to apply -  variable name contains help or variable name contains emergency

Script : Execute if true

g_form.setValue('assignment_group','019ad92ec7230010393d265c95c260dd'); //sysid will be assignment group sysid 

RJ34_0-1672324398891.pngRJ34_1-1672324413318.pngRJ34_2-1672324450916.png

Please mark my response as Correct / Helpful based on Impact.

 

Mariem
Tera Contributor

Hello RJ34,

thank you for taking the time to reply😃. This is good but how can I specify in the script which assignment group I want to use?

Hi Mariem,

You can create an array of the assignment group and depending on the short description you can set the assignment group value.

 

Thanks,

RJ

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
For this you can write assignment rules.

 

Define assignment rules (servicenow.com)

 

Create an assignment rule (servicenow.com)

 


Thanks and Regards,

Saurabh Gupta