- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2020 04:42 PM
I've been searching the community but nothing has come up that will work for me. I'm trying to enhance a catalog item we have that is for managing group membership. We'd like the person submitting the request to be able to select a user from a list and then the groups that user is in displays.
Essentially, it would be useful for the submitter to know which groups they were in (or another user was in) to make an educated guess about what group to put the other person into (e.g. "I know I have Case access, and this guy needs Case access, so which group do I have?").
So something like this:
[Selected User]
Assignment Groups:
• Group A
• Group B
Other Groups:
• Group C
• Group D
Is this doable? Will I need to engage the devs on my team? I'm not coder myself, although I can manipulate existing scripts to work in some cases.
Thanks,
Steve
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2020 05:56 PM
Then you will have to create Script Includes like below
var commonUtil = Class.create();
commonUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getUserGroups: function(user) {
var groups = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user', user);
gr.query();
while (gr.next()) {
groups.push(gr.group.sys_id);
}
return 'sys_idIN' + groups.toString();
},
type: 'commonUtil'
});
On variable of for groups do below
javascript:new commonUtil().getUserGroups(current.variables.person_to_mirror);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2020 05:21 PM
if you want to auto populate then try below
javascript:'user='+ current.variables.youruservariablename;
to default field on list collector variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2020 02:53 PM
Hey thanks, Mike, I used your suggestion. I think this is pretty close, except it's showing me one instance of my user name for every group I'm in instead of showing me the group list (see below; my admin user is in 2 groups). Is there a way to flip it so that it shows the groups?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2020 05:03 PM
Are you trying to show groups of requesting associates ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2020 05:12 PM
More like groups of someone they select from a list. I've just got it set up here to use the "requesting associate" for proof of concept. I'll add another variable called "Person's access to mirror" (person_to_mirror) in the final form. Thanks so much for your help.
Steve

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2020 05:56 PM
Then you will have to create Script Includes like below
var commonUtil = Class.create();
commonUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getUserGroups: function(user) {
var groups = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user', user);
gr.query();
while (gr.next()) {
groups.push(gr.group.sys_id);
}
return 'sys_idIN' + groups.toString();
},
type: 'commonUtil'
});
On variable of for groups do below
javascript:new commonUtil().getUserGroups(current.variables.person_to_mirror);