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

As a final "FYI", instead of using a hard coded sys_id, use a property with the name of the default assignment group. For example, onbase.default.assignment_group = Networking



In your script, you do this:



var defaultGroupName = gs.getProperty('onbase.default.assignment_group');


current.assignment_group.setDisplayValue(defaultGroupName);



Now if you want to change the group, just change the property, not the code!


This is great!   Thanks Chuck!



Fred


anitha0887
Tera Contributor

Hi @j3d1 

 

please can help on this query,

there is comments field on record producer, based on keyword of description, category field of incident record will be auto filled.i wrote below code, its not working.

ex: comments on record producer  contains as " user not able to access data from database"

here keyword is database.so category = "Dev Apps, Packages, Platforms";

if(producer.comments.toLowerCase().indexOf('database') >=0){
   
    current.category = "Dev Apps, Packages, Platforms";