Get all groups of user

Puru2
Tera Contributor

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

3 REPLIES 3

Ahmmed Ali
Mega Sage

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

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

create your own api if you are not satisfied create scripted rest api

Nitesh Balusu
Giga Guru

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]);