- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2017 07:05 AM
At the moment some of the approval groups have just one member in the group. I have to identify those groups so that we can add additional members. How can I find the gorups with just one member?
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2017 07:14 AM
You can use a report (or list V3) to query for groups that have exactly 1 group member. See screenshot for an example.
If you don't have list v3 or the Istanbul+ report builder enabled, you will need to write a script. The script would query for all groups, then for each group, get the count of the group members. If the count of the group members is exactly 1, then you would write it to the log or do something else with it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2017 07:14 AM
You can use a report (or list V3) to query for groups that have exactly 1 group member. See screenshot for an example.
If you don't have list v3 or the Istanbul+ report builder enabled, you will need to write a script. The script would query for all groups, then for each group, get the count of the group members. If the count of the group members is exactly 1, then you would write it to the log or do something else with it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2020 11:55 AM
Is there a "new" way to do this? I've looked and the "Related List Conditions" section is nowhere to be found. EIther the implementation (SNOW) has changed or I somehow don't have the privileges to access this. I'm trying to find Problems without associated Tasks (PTASK). Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2017 07:19 AM
What do you want to use to identify groups that have 1 member? If it a script, then you can use like this as example,
var grp = new GlideRecord('sys_user_group');
grp.query();
while(grp.next()){
//Query for the number of group members
var grpm = new GlideAggregate('sys_user_grmember');
grpm.addQuery('group', grp.sys_id);
grpm.addAggregate('COUNT');
grpm.query();
var groupMembers = 0;
if(grpm.next()){
groupMembers = grpm.getAggregate('COUNT');
grp.u_group_members = groupMembers;
}
The script above go through all groups and count how many members each group. You can add verify in that script if the group have 1 member then you do something from there.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2017 07:20 AM