How to Auto-assign Assignment group based on Description (Record Producer)

fpuzon
Tera Contributor

Hi everyone,
I'm trying to add some logic to our Incident Record Producer script so that when a user submits the form through ESS with our 'Issue Type' variable set to 'Applications' and the Description contains the phrase 'onbase' to auto-assign to a particular group.   Has anyone done something similar?   Any help is appreciated.

Thanks,
Fred

Issue Type.jpgDescription.jpg

1 ACCEPTED SOLUTION

j3d1
Giga Contributor

Hey Fred,



Adding this if statement to your record producer script should achieve what you're looking for.



if(current.[field "value" for issue type] == ["value" for applications] && current.["Value" for description].toLowerCase().indexOf('onbase') >=0)


{


        current.assignment_group = "[sys_id of desired assignment group]";


}



if it doesn't work, try replacing "current" with "producer" and give it another go.



Good Luck,



-Ben


View solution in original post

17 REPLIES 17

Chuck Tomasi
Tera Patron

Sounds like a use case for Assignment Rules Fred.



Defining Assignment Rules - ServiceNow Wiki


Hi Chuck,


Thanks for chiming in!   I tried that initially, however the assignment group was still showing our default "Help Desk' group.       I would imagine I could get away with basic conditions.   Could there be something else I'm missing?


Onbase Rule.jpg


ECM.jpg



Incident.jpg


The condition is case sensitive. You may have to use the "matches regex" operator on your condition. I haven't had much experience with this. The (untested) example below is a guess based on my regex experience.



find_real_file.png


Minor correction, I think it should be Description matches regex .*onbase.*