
- 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 10:03 PM
Hi Jimboy,
you can restrict the user based on assignment group in your assignee List via " Dependent" also.i am not saying via reference qualifier you can't do that. this is the another option for you if you are on form.
Note:- This functionality is only available on form.
Hope it will help you. here you don't need to write additional script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 11:40 PM
How can we reference this field dependency setting on our script to show users of another group depending on the value of Assignment Group? (Example, show users of Group X when the Assignment Group is Group A.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 11:16 PM
Restrict Assignee based on assignment group.
var testi = Class.create();
testi.prototype = Object.extendsObject(AbstractAjaxProcessor, {
testing:function() {
var gp = ' ';
var a = current.assignment_group;
gs.log('value is'+a);
//return everything if the assignment group value is empty
if(!a)
return;
//sys_user_grmember has the user to group relationship
var grp = new GlideRecord('sys_user_grmember');
grp.addQuery('group',a);
grp.query();
while(grp.next()) {
if (grp.length > 0) {
//build a comma separated string of user if there is more than one
gp += (',' + grp.user);
}
else {
gp = grp.user;
}
}
return 'sys_idIN' + gp;
},
type: 'testi'
});

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 11:19 PM
Thanks for this. How would this work if for example, we want to show users from group X when the Assignment Group is set to Group A or show users from group Y when Assignment Group is set to Group B?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 11:24 PM
Hi Jimbody,
let's suppose we have 2 group. hardware and software. in hardware group we have 5 and in software we have 7 members.
it will work when you select hardware in assignment group then it will be filter and show only 5 members in assignee list field it will work same way for software.
if you select software then 7 members will be come into list when you will try to click on assignee list field.
let me know if you need further help