How to I make a new ticket auto assign to an Assignment Groups

juliochacon23
Tera Expert

Hi, I need help.   If an employee submits a new incident on our ServiceNow Self Service Page, we want the incident to be auto-assigned to a specific assignment group if they check a check box on the new incident form before submitting the incident.   The check box is tied to a field in the incident form.   Is this a business rule? See screenshot below

ticket.JPG

Thanks

-Julio Chacon

1 ACCEPTED SOLUTION

Check if there is any BR on the table or any script in the record producer doing this.


View solution in original post

12 REPLIES 12

Gurpreet07
Mega Sage

Following code may help you :



1. create variable assignment_group on the same record producer and hide it on form onLoad .


2. in a onSubmit catalog client Script use following type of code .




if(g_form.getValue('is_this_a_bt_issue')){                     //verify the back end name of the checkbox


                  g_form.setValue('assignment_group','sys_id_of_assignment_group');


}


Hi Gurpreet,



In my opinion, It's better to work from Server than from Client, due to, Incidents could also be created out of the record producer, and in this case, this automation won't work. So, moving to an Assignment Rule, the code could be something like this:



if(current.u_is_this_a_bt_issue') {                   //verify the back end name of the checkbox


                  current.assignment_group = sys_id_desired_group;


}



Best Regards


Yes , it should work in this way and its even better but you can't use current.u_is_this_a_bt_issue because its not a field on incident table.   Probir Das's solution may work perfectly.


Hummm ..



Yes, you're right!, for this kind of things is why I always copy variables from producer to Register!


ProbirDas
Tera Expert

Find the record producer with the name "Report something is broken"



In the script field of the record producer, add the following lines



if(producer.<variable name of Is this a BT issue?>){                


  current.assignment_group = "the sys_id of the group that you want to populate";


}