- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2018 11:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2018 11:44 PM
Hi Prakash
use the below script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2018 11:44 PM
Hi Prakash
use the below script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2018 11:51 PM
Hi
If you want to get group name of particular user then use the below
var grr = new GlideRecord('sys_user_grmember');
grr.addQuery('user', 'XXXXX'); //User Sys ID
grr.query();
while(grr.next()){
gs.print(grr.group.name);
}
Or
var grr = new GlideRecord('sys_user_grmember');
grr.addQuery('user.name', 'YYYY'); //User Name
grr.query();
while(grr.next()){
gs.print(grr.group.name);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2018 11:57 PM
This will give all the group names where the user is present in multiple groups
var members = [];
var grpMbr = new GlideRecord('sys_user_grmember');
grpMbr.addQuery('user',gs.getUserID());
grpMbr.query();
while (grpMbr.next()){
members.push(grpMbr.group.name.toString());
gs.print("HAR"+grpMbr.group.name);
}
Harish