Restrict the approvals to only few members of an assignment group using approval-user item in workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 04:10 AM
Hi team,
We have a requirement to restrict approvals to a few members of an assignment group which consists of 20+ members.
Out of all, we need to sent approvals of a request to only 4 members using workflow(Approval-User) item.
Could you please help us in achieving this requirement?
Regards,
Padmaja.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 04:45 AM
Hi,
Use below script, Mark my answer as correct or hit like based on impact.
answer = [];
var mbr= new GlideRecord('sys_user_grmember');
mbr.addQuery('group', gr.sys_id.toString()); //or use following line instead
//mbr.addQuery('group', '1'); //replace 1 with sys_id of group
mbr.addQuery('user','IN','1, 2, 3'); //replace 1, 2, 3 with sys_ids of users to include
mbr.query();
while(mbr.next()){
answer.push(mbr.user.toString());
}
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 01:15 AM
Hi Rasheed,
Thanks for your suggestion. Can we use this code in advances scripting part of Approval-User activity in workflow?
Or is there any way where we can filter out the members of the group near the "user" field inside the "Approval-User" activity?
Regards,
Padmaja.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 01:59 AM
No, you have to use the code in advance scripting part in 'Approval - Group' activity and not in Approval - user activity as there are multiple users involved. Please try and if it works mark my answer as correct.
Regards,
Musab