- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2016 08:30 AM
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
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2016 09:10 AM
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'));
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2016 08:33 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2016 08:34 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2016 08:57 AM
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:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2016 08:58 AM
See my response.