Auto assignment to user when creating an incident

adamcarty
Kilo Explorer

Hi Everyone

This may seem like its been done before, but I cant seem to find anything that works, or quite what i want.
I want to be able to make it so when a service desk analysts selects new incident, the first thing the ticket does is automatically assign the analyst's assignment group and assigns the ticket to them. Most solutions I have seen does this when the ticket is saved. Is it possible to do this on initial loading of the ticket?

Thanks
Adam

4 REPLIES 4

Slava Savitsky
Giga Sage

Hi Adam,

The simplest way to achieve this is to create an onLoad client script. However, client scripts making calls to the server can have negative impact on web browser performance, especially if you use Internet Explorer.

A better option is to use a JavaScript function as the default value for Assignment Group and Assigned To fields. Here is an example:
http://wiki.servicenow.com/index.php?title=Creating_New_Fields#Specifying_a_Default_Value

The main problem here is that users can have membership in multiple groups. So you will need to implement some advanced logic to make sure the most appropriate group is selected.

Regards,
Slava


apoorvmehta
Kilo Expert

You should consider an advanced script condition for default value of the assignement group field.


Ashutosh Munot1
Kilo Patron
Kilo Patron

I have done it with easiest way,



Write a Advance Script for (fields you want to auto assign) and just auto assign the logged in user and Assignment group to it.



Just filter out which group you want becoz many user have multiple groups.



scripts condition may be:



onload script:


get user id assign and assign it to assigned to field


and then assignment group of that congifuration item to assignment group. this is simplest way to filter groups.


randrews
Tera Guru

one other option is to write a view br for incidents that sends the users assignment group to the record on the scratchpad... then you can address that scratchpad variable in a client script...



obtw.. i personally would probably write a script include something like AAgetMyGroups()   with the logic needed to get the group of the user and put it in the default value field... it is a little cleaner.   <where the AA is your company abbreviation>