
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 02:40 PM
Hi. I need to present a variable in a request form for a Catalog Item that allows the requester to select one of their manager's assignment groups from sys_user_group.
How can I create a reference qualifier on the variable so that only the requester's manager's groups are available as options?
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 09:24 AM
Ok so what you can try to do in the original script is add the following line to get your support groups.
gr.addQuery('group.type', 'CONTAINS','eb6c00b0db3700507e99e855ca9619b5'); //this needs to be the sys_id of the group type you want

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 03:25 PM
Do you have another field that contains the users manager. Either by having them select it or having it auto populate based on the logged in user?
If not you will need to do a script include to return the groups as you will first have to lookup there manager from the sys_user table. This is all assuming that there manager is listed as the group manager on the sys_user_grmember table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 04:28 PM
Hello @JR42 ,
You can use advanced reference qualifier and call script include to get the requester's manager groups.
For your Reference:-
You can create a script include with name 'getRequestedForDetails' and make it client callable. And, write the below script.
var getRequestedForDetails = Class.create();
getRequestedForDetails.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getReqManagerGroup: function(userid) {
var user = new GlideRecord('sys_user');
user.addQuery('sys_id', userid);
user.query();
if (user.next()) {
var arrGroup = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user', user.manager);
gr.query();
while (gr.next()) {
arrGroup.push(gr.group.toString());
}
}
return 'sys_idIN' + arrGroup;
},
type: 'getRequestedForDetails'
});
Then, you can call script include in your advanced reference qualifier as shown in below screenshot.
Note:- Update the variables backend name in the reference qualifier parameter.
Please Mark my answer Helpful & Accepted if I have answered your question.
Thanks,
Alka

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 08:56 AM
Hi @Alka_Chaudhary Thanks for the guidance!
I've set this up, but the variable is not returning any options.
Can you elaborate on what you mean by, "Update the variables backend name in the reference qualifier parameter."?
javascript: new getRequestedForDetails().getReqManagerGroup(current.variables.requested_for);
Here is the Variable and Reference Qualifier:
Here is the Script Include:
This is what it looks like in the request with the current setup:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 09:06 AM - edited 11-10-2023 09:07 AM
Hello @JR42 ,
What is the name of the variable which is referring to user table?
And, also could you check the client callable checkbox in the script include and try it. Please refer the below screenshot.