- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks 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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks 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
3 weeks ago
Hi sarthak,
Code is working as expected. Thanks for your contribution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @satya609
When you have time, please take a second to mark @Sarthak Kashyap's reply as an 'Accepted Solution' and 'Helpful'.
In doing so, you are not only acknowledging the time and effort that was put into responding to your question, you're also helping future readers who might have similar queries.
Thank you!