Restrict the approvals to only few members of an assignment group using approval-user item in workflow

Yerramilli Padm
Giga Contributor

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.

3 REPLIES 3

Musab Rasheed
Tera Sage
Tera Sage

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());
}
Please hit like and mark my response as correct if that helps
Regards,
Musab

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.

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.

Please hit like and mark my response as correct if that helps
Regards,
Musab