- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-15-2018 04:22 AM
Hello Experts,
I need help in reference qualifier..!!
Basically i should filter the assigned_to field by 2 conditions.
1) assigned_to choices should be the member of the group
2) assigned_to should have a role "DP Fracas"
I am trying something like this basically in ref qual but not working
need to satisfy both the conditions.
Note: When you clear out the assignment group then assigned to should have no choices
Regards,
Chalan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-15-2018 06:46 AM
Hi try the below client-callable script include and reference qualifier.
Note: you can access current object in script include
var GetUserFromAssignmentGroup = Class.create();
GetUserFromAssignmentGroup.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getUsers: function(){
var sid='';
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group", current.assignment_group);
gr.query();
while (gr.next()) {
var ur = new GlideRecord("sys_user_has_role");
ur.addQuery("user", gr.user);
ur.addQuery('role','sys_id_of_your_role');
ur.query();
if (ur.next()) {
sid += ur.user+',';
}
}
return 'sys_idIN'+sid;
},
type: 'GetUserFromAssignmentGroup'
});
javascript: new GetUserFromAssignmentGroup().getUsers();
P.S.: Kindly mark correct if this resolved your issue. It will help future seekers in getting correctly working answers.
Regards
AirSquire

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-15-2018 05:02 AM
Dependent is already set on the base dictionary for assigned_to - according to your screen shot.
That means you just want to Override the reference qualifier and add roles=x
where x is the role name. The role name cannot have a space in it and should be all lower case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-15-2018 05:02 AM
Hi Chalan,
you are trying to call some method. where it is written? Is it inside any script include.
Why are you forming the query string in reference qualifier instead form it in script include and query and then return sys ids array.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-15-2018 06:46 AM
Hi try the below client-callable script include and reference qualifier.
Note: you can access current object in script include
var GetUserFromAssignmentGroup = Class.create();
GetUserFromAssignmentGroup.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getUsers: function(){
var sid='';
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group", current.assignment_group);
gr.query();
while (gr.next()) {
var ur = new GlideRecord("sys_user_has_role");
ur.addQuery("user", gr.user);
ur.addQuery('role','sys_id_of_your_role');
ur.query();
if (ur.next()) {
sid += ur.user+',';
}
}
return 'sys_idIN'+sid;
},
type: 'GetUserFromAssignmentGroup'
});
javascript: new GetUserFromAssignmentGroup().getUsers();
P.S.: Kindly mark correct if this resolved your issue. It will help future seekers in getting correctly working answers.
Regards
AirSquire