- 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 09:40 AM
Empty the groups which says ${assignment_group} and you should be good to go.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2016 09:47 AM
If i could send you a gift basket I would.. LOL. Thanks for the help!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2017 05:02 AM
Hello,
first of all, all the best in the New Year. I am quite interested in this topic as well, but the script is doing nothing for me, Still, the approval is requested from all members. You have advised to "Empty the groups which says ${assignment_group} " but not sure how you meant it. How I should empty my assignment group?
Thank you
Andrej
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 07:34 AM
Hi Andrej, happy new year!
Make sure your approval activity in the workflow is a USER approval activity, not a GROUP approval. Then, when filing out the approval activity, you'll see a "users" and "groups" input fields. Leave those blank. Instead, use JUST the script to call out which group will get the approval.
(If you scroll to the right on the screenshot above, you'll see that Groups field)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2016 09:48 AM
LOL. Glad you got your question answered.