Exclude specific person from a group approval

t_a_rogers
Kilo Expert

Hi All,


In our Change Management process we have 3 linear approvals:

1) Peer approval (Should be a team member double checking the work in the change request)

2) Manager approval (a team manager validating this should take place) - Sends to Assignment Group "Manager"

3) CAB approval

Right now step 1 sends a group approval request to all members of the Assignment Group. The issue with this is some groups have the Manager also as a team member, so the manager sees the peer approval request and tries to approve that. We tell them   "Don't approve the peer approval if you're a manager" but they are confused.


SO: Is there a way to exclude a person from a group approval? Say, ServiceNow checks and sees you are a group manager and it skips sending you the approval request on the peer approval step?


I have no idea how to write this type of script, so your input would be helpful


Thanks,
Travis

1 ACCEPTED SOLUTION

Here you go



answer = [];


var gr= new GlideRecord('sys_user_grmember');


gr.addQuery('group',current.assignment_group);


gr.addQuery('user','!=',current.assignment_group.manager);


gr.query();


while(gr.next()){


answer.push(gr.getValue('user'));


}


View solution in original post

17 REPLIES 17

Abhinay Erra
Giga Sage

You can use Approval User activity in the workflow and use advanced script section and push all the approvals except the manager.


Approval - User workflow activity


Chuck Tomasi
Tera Patron

Here's an example of one I did last summer for a similar circumstance.



backgroud script-to remove one approval level from all approval group


Chuck - That script seems to run through and do an automated removal of the specific person from the approval group. In our case, we want the manager to stay a member of the assignment group (some of these are small teams so the manager also does queue work) but we don't want that manager to get the peer approval request when it get's generated to the entire team, since they will get the subsequent manager approval request:



find_real_file.png


See my response.