
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 08:30 PM
We are trying to add a reference qualifier for the field Additional Assignee List to limit the users shown on the lookup for users that are members of a certain group. We can see that there is a filter value for the role the user has but there is none for the groups he is part of.
UPDATE:
Thanks to everyone who provided feedback, especially to explorenow and harshvardhansingh.
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2017 03:49 AM
Hi explorenow thanks for this, we used this and modified a bit to fit on our exact requirement.
For other users with this similar requirement, just refer to the steps below:
Here's the final script we used to achieve our requirements:
var FindGroupMember = Class.create();
FindGroupMember.prototype = {
initialize: function() {
var grp = current.assignment_group;
var x; //Variable that will hold the group of members you want to show
//If Assignment Group is Group A then show members of Group B
if(grp=='<insert sys_id of Group A>'){
x = '<insert sys_id of Group B>';
}
//Code to return members of the group
var answer = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('group', x);
gr.query();
while(gr.next()){
answer.push(gr.user.toString());
}
return 'sys_idIN' + answer;
},
type: 'FindGroupMember'
};
HOW TO SETUP:
- Create a new script under System Definition > Script Includes
- Use the final code above
- Configure the Dictionary of Additional Assignee List field
- DO NOT change the setup on Reference Specification
- Go to Dictionary Overrides on the bottom of the page and click New
- Change table to Incident (this allows you to just change the lookup of Additional Assignee List field while you are on Incident table, on other tables, it will just work as OOB)
- Check 'Override reference qualifier'
- Paste the code below on the R
javascript:new FindGroupMember().initialize();
RESULTS:
When Assignment Group is Group A, then lookup for Additional Assignee List will return users of Group B.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 11:28 PM
Hi Harshvardhan, thanks for that explanation however we need to show the users of another group when an Assignment Group is selected and not members of that Assignment Group.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2017 12:38 AM
you mean whenever you select "Hardware" group you don't want the member of "hardware" in assignee list. am i correct?
if this is your requirement then please find the script below. i just used "!=" operator.
if user has selected "Hardware" then i simply used
add.Query('group','!=','<hardware group sys id>');
it will give me the list of users apart from the hardware members.
gp='';
var c=0;
var grp = new GlideRecord('sys_user_grmember');
grp.addQuery('group','!=','404cedd5930112003b4bb095e57ffbf4');
grp.query();
while(grp.next()) {
c++
if (grp.length > 0) {
//build a comma separated string of user if there is more than one
gp += (',' + grp.user);
gs.print('if part:'+gp);
}
else {
gp = grp.user;
gs.print('else part:'+gp);
}
}
gs.print(c);
you just need to modify addQuery() line that i highlighted .
hope it will help you