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

For example if I was in the Assignment Group "Operations (Primary)" and the group "Service Desk (Secondary)" when i apply the template it will auto fill with the Primary Group that i am in, is this possible? 

yes this can be achieved by Client Script (GlideAjax) + Script Include


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

I see, so if I used an assignment rule this would work? 

Does an Assignment Rule work when a template is applied?

If I used an assignment rule how would I do this? 

 

 

@Faben Vieira  Assignment rule works upon change on record. First, create the template and then create an assignment rule.

SO, whenever the template is applied on record based on condition in assignment rule Assignment group will be populated on record.

  1. Assignment group population based on Primary group/secondary group can be achieved by Client Script (GlideAjax) + Script Include.
  2. No, Assignment rules do not apply to unsaved changes on a form.

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

Thank you both for your help so far it is starting to make a lot more sense for me. 

 

In regards to: 

  1. Assignment group population based on Primary group/secondary group can be achieved by Client Script (GlideAjax) + Script Include.

I am not very familiar with this, would there be a way to find out how i can go about setting this up?