When applying template, auto assign Assignment Group and Assigned to based on who is applying the template/logged in?

Faben Vieira
Kilo Contributor

Good Afternoon,

I am attempting to setup a few Incident templates and I would like them to auto fill the Assignment Group and Assign To fields when the template is applied.

Currently I have javascript:gs.getUserID(); to auto fill the Assigned To field with the current logged in user and this works fine and does the job.

However, is there a similar line of code etc. that could also auto fill the Assignment Group of the logged in user?

We are trying to refrain from using long client or server side scripts but can do if needed. 

(I have attached a screenshot of the code above within the template and then also one of when the template is assigned)

This is require as without this being auto filled the ticket wont log.

Any help is much appreciated. 

 

10 REPLIES 10

Check below links 

https://developer.servicenow.com/dev.do#!/reference/api/quebec/client/c_GlideAjaxAPI

https://community.servicenow.com/community?id=community_article&sys_id=9f7ce2e1dbd0dbc01dcaf3231f961...

https://docs.servicenow.com/bundle/paris-application-development/page/script/ajax/topic/p_AJAX.html

Client Script(OnLoad or Onchange of any field)

I can provide you complete code but you can try out and let us know if you are stuck anywhere.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP