Get all groups of user

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2018 08:31 AM
Dear All,
The following API returns all active groups of any user : getMyGroups() //as per the definition from SNOW
Is there any API available which returns all the groups of a user in SNOW (irrespective of Active field of group) ?
Best Regards,
Jason
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2018 08:39 AM
I don't think there should be any which returns even inactive groups also.
for the same, you can query "sys_user_grmember" table for particular user.
Thanks,
Ali
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2018 12:29 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2018 01:07 PM
Just tried this in my personal Dev, getMyGroups() is returning list of inactive groups as well for a user. Please try it out.
var groupsArray;
groupsArray=gs.getUser().getMyGroups().toArray();
for(var i=0;i<groupsArray.length;i++)
gs.info("groups are " +groupsArray[i]);