- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-31-2022 11:29 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-31-2022 11:44 PM
Hi,
Try below code in background script.
var grGroup = new GlideRecord(sys_user_grmember);
grGroup.addQuery('group','GROUP_NAME');
grGroup.query();
while(grGroup.next()){
gs.info(grGroup.getDisplayValue('user'));
}
If you want to run in BR then configure BR on sys_user_grmember table and use above code (do not glide then use the current object)
Mark this as Helpful/Correct, if Applicable.
Regards,
Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-31-2022 11:37 PM
Hi
Try the below code in the background script
var arr=[];
var getMembers = new GlideRecord('sys_user_grmember'); //Group membership table
getMembers.addQuery('group', 'group_sys_id'); //Query with Application Development group sys_id
getMembers.query();
while(getMembers.next()){ //Iterate over records
arr.push(getMembers.getDisplayValue('user')); //Push Display value of users into array
}
gs.print(arr); //Print array

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-31-2022 11:44 PM
Hi,
Try below code in background script.
var grGroup = new GlideRecord(sys_user_grmember);
grGroup.addQuery('group','GROUP_NAME');
grGroup.query();
while(grGroup.next()){
gs.info(grGroup.getDisplayValue('user'));
}
If you want to run in BR then configure BR on sys_user_grmember table and use above code (do not glide then use the current object)
Mark this as Helpful/Correct, if Applicable.
Regards,
Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-31-2022 11:44 PM
Hi
I have a couple of questions
1) Where do you want to display that user's name using the Business rule. Is it in a specific field or just an info message?
2) When do you want to display that user's list? On create or on an update?
Regards,
Gunjan Kiratkar
Consultant - ServiceNow, Cloudaction
Rising Star 2022