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

Jon Barnes
Kilo Sage

may be better to do it in a before insert business rule.   that way in case you decide to make that a property (instead of hard coding a group's sys_id), you can do the look up server side before the record is saved.   Also, if you use a client script, it won't apply if an incident is created through an integration.


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


Your condition should be



current.isNewRecord()



and make sure you have the INSERT checkbox on the "When to run" section checked.


Works now. Thanks a lot all.