How to populate assignment group based on user location?

Raghu9
Kilo Expert

Hi,

In incident form we have affected CI field. For each CI we have one default support group. Now based on user location we need to populate assignment group for that CI. How can we achieve that? Please give me any ideas. 

5 REPLIES 5

Omkar Mone
Mega Sage

Hi 

Please go through the below thread which has the answer of what you require :- 

https://community.servicenow.com/community?id=community_question&sys_id=64df76addb58dbc01dcaf3231f96...

 

Mark Correct answer if i have helped  you.

 

Regards,

Omkar Mone

www.dxsherpa.com

Omkar,

Thank you for your response.

If we want to do through script how can we do?

Hi 

Try creating a before business rule :- 

(function executeRule(current, previous /*null when async*/) {



// Add your code here


var userLoc = current.caller_id.location;


var gr = new GlideRecord('sys_user_group');


gr.addQuery('PASS LOCATION FEILD COLUMN HERE', userLoc); //Assuming this field is a reference field

gr.query();

if(gr.next());

{

current.assignment_group = gr.sys_id;

}




})(current, previous);

 

 

Why? Why not use the OOB none scripting way which is probably the best way. If you still want to script and do dynamic ways, you can script the outcomes in a assignment rule as well.

 

//Göran
Feel free to connect with me: