- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 11:16 AM
Is there a way to generate a report, on platform, of users in one group? Note, I'm not trying to find all users in a specific group. I just want to know which users are in a single group (could be any group) at a given point in time.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 11:02 PM
Hi @Brian Bouchard ,
Create a report based on the sys_user which related list condition for group where equal to 1 as shown below:
If my answer has helped with your question, please mark my answer as accepted solution.
Best regards
Anders
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 12:52 PM
Hi @Brian Bouchard You can try with script , create one client callable script include and call it in your report.
Sample Code:
var checkNew = Class.create();
checkNew.prototype = Object.extendsObject(AbstractAjaxProcessor, {
test: function() {
var arr = [];
var ga = new GlideAggregate('sys_user_grmember');
ga.addAggregate('COUNT', 'user');
ga.query();
while (ga.next()) {
var ucount = ga.getAggregate('COUNT', 'user');
if (ucount == 1) {
var ga1 = new GlideAggregate('sys_user_grmember');
ga1.addEncodedQuery('user=' + ga.user);
ga1.addAggregate('count', 'sys_id');
ga1.query();
while (ga1.next()) {
arr.push(ga1.getUniqueValue());
//gs.print('User '+ ga.user.getDisplayValue() + ' Is only available in this group ' + ga1.group.getDisplayValue());
}
}
}
return arr.join(',');
},
type: 'checkNew'
});
Note: Report will be on Group Member table and use below filter.
Sys ID | IS One Of | javascript : new checkNew().test()
Hope it will help you.
Thanks,
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 01:30 PM
Hi @Brian Bouchard,
I think you can use the 'Related list conditions' in the report for this, something like the following:
Make sure you set the Quantity to Equal to 1.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 11:02 PM
Hi @Brian Bouchard ,
Create a report based on the sys_user which related list condition for group where equal to 1 as shown below:
If my answer has helped with your question, please mark my answer as accepted solution.
Best regards
Anders