How to assign incidents depend upon the user location?

gokulraj
Giga Expert

Hi all,

  I have a requirement to assign the assignment group automatically for all incidents depends on the user location.I need a script for this.Please, suggest   your ideas.

27 REPLIES 27

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi Gokulraj,



You can create a datalookup rules for this instead of code.



Where is this mapping store?



Anyways if you want code then see below:



Business Rule:


BEfore Insert:



var gr = new GlideRecord('custom table where mapping store');


gr.addQuery('location field',current.caller_id.location);


gr.query();


if(gr.next())


{


current.assignment_group = gr.group_field in custom table;


}



Code is just for INFO. BUT use datalook up rules.



Thanks,


Ashutosh


Dubz
Mega Sage

Hi Gokulraj,



You can do this with assignment rules quite easily.



Go to System Policy > Rules > Assignment and you can set them up in there. You can either create a rule for each location by dot-walking to the caller fields in the filter conditions or you can write a script, the script tab has an example format that you could very easily modify.


table no record.PNG



I have created a new table for assignment group and location.but it does'nt contain any records.Please,suggest some ideas.


Hi,



Did you created Assignment rules?



If yes, then you have to add records there depending upon your requirement.


For example: Location is ABC then Assignment group is Service Desk.



Then go create new incident with location as ABC and see you assignment group will be Service Desk.



Thanks,