if want to restrict assigned to field based on caller id location
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
If caller id location is matches with the users in the assignment group then i want to see those users in the assigned to field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
48m ago
Hi @satya609 ,
I tried your problem in my PDI and it works fine for me please check below solution
navigate to your incident record right click on assigned_to field and click on Configure dictionary
In related list of dictionary override check for incident record and open it
In Reference Qualifier add below script
javascript: new global.checkLocationCaller().callerLocationCheck(current.caller_id, current.assignment_group);
Create new Script Include and add below code
var checkLocationCaller = Class.create();
checkLocationCaller.prototype = {
initialize: function() {},
callerLocationCheck: function(inc_caller, inc_group) {
gs.log("SI Called checkLocationCaller");
var callerCountry = "";
var u = new GlideRecord("sys_user");
if (u.get(inc_caller) && u.location && u.location.country)
callerCountry = u.location.country.toString();
var result = [];
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group", inc_group);
gr.addQuery("user.active", true);
gr.addQuery("user.location.country", callerCountry); // dot-walk filter
gr.query();
while (gr.next()) {
result.push(gr.user.toString()); // only user sys_id
}
return "sys_idIN" + result.join(",");
},
type: 'checkLocationCaller'
};
Result:
Caller Location Country is USA
In Assignment Group Below users location country is USA
So When I click on Assigned To it will show me users which country is USA
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
44m ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
43m ago
Thanks @Mohammed8 😄
