- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
In the assigned to i want to see particular group members name without applying anything on assignment group. which query i need to use in reference qualifier
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @pavithraptr,
on the variable where you want to select the group members you need to call script include that will return the group members.
Something like this:
variable's ref qualifier on sys_suer table:
javascript: 'sys_idIN' + new groupUtils().getSandstormMembers();
calling script include called groupUtils and function getSandstormMembers()
And the script include:
var groupUtils = Class.create();
groupUtils.prototype = {
initialize: function() {},
getSandstormMembers: function() {
var userIDs = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addEncodedQuery('group=YOUR_GROUP_SYS_ID^user.active=true');
gr.query();
while (gr.next()) {
userIDs.push(gr.user.toString());
}
return userIDs.join(',');
},
type: 'groupUtils'
};
This will return just the active members, so even a group member of that group who is inactive won't be selectable. If you want to allow inactive suers as well, remove the "^user.active=true" part from the encoded query.
Let me know if this helped, works fine for me
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have a group called leads. In the form i have a assessment leads field.When i try to select assessment leads it should only show members who are members of leads group