How to populate assignment group based on user location?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2018 05:06 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2018 05:07 AM
Hi
Please go through the below thread which has the answer of what you require :-
Mark Correct answer if i have helped you.
Regards,
Omkar Mone
www.dxsherpa.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2018 05:12 AM
Omkar,
Thank you for your response.
If we want to do through script how can we do?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2018 05:18 AM
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2018 05:34 AM
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.