Client script to set default assignment group

Anna L
Tera Contributor

When an incident is created, default assignment group should be set as "IT Systems". I was told that the best practice is to create a client script instead of setting the default value in form design.

Can anyone share script (screenshot) and suggestions?

1 ACCEPTED SOLUTION

Mike Allen
Mega Sage

Client scripts are subject to the whim of the client browser.   I think it is best practice to move as much of the processing as you can to the server.   I would not go Client Script here.



I would do the before insert that was suggested above.



find_real_file.png


View solution in original post

15 REPLIES 15

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Ronald,



Agree with everyone on this thread to create a before business rule.Please make sure don't use current.update in before business rule to avoid performance issue.


Business Rules Best Practices - ServiceNow Wiki


larstange
Mega Sage

Hi Ronald



You should use the OOTB functionality under System Policy -> Assignment.



Here you can se the assignment for a given task type (eg. incident) based on a condition. If you leave the condition empty it will assign all incidents which are saved with an empty assignment.


This way it will also catch incidents comming in through integrations (Webservice and REST) or via emails and it does not require any coding.


It's funny how all the nerds gravitate to scripting when there's a perfectly easy way to do this without scripting.



Defining Assignment Rules - ServiceNow Wiki



And I count myself as one of the nerds!


Anna L
Tera Contributor

I am doing this,


On Incident Table


for active = true, assign it to "Service Desk"



find_real_file.png



find_real_file.png


Is this correct?


That looks right. Just be sure to take out the business rule you were trying before.