- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2018 10:40 AM
Hello Experts,
I have a need to do a multiple group approval, however, I cannot get a user from both groups to do an approval. If one user approves from either group, the approval gets marked approved and workflow moves on. The reason I am using User approval vs. Group approval is that I need to add in a condition to remove requested_by user from both approval groups to prevent the user from doing their own approval, if they are part of the 2 groups linked to the CI.
var gr = new GlideRecord('u_business_ci');
gr.addQuery('u_ci',current.cmdb_ci);
gr.addQuery('user.sys_id', '!=', current.requested_by);
gr.query();
var answer= [];
while(gr.next()){
answer.push(gr.u_bu.u_bu_group);
}
Please help!
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2018 12:15 PM
There are several solutions documented on the community on how to prevent users from approving their own requests. I personally prefer the last solution documented in this thread that prevents a sysapproval_approver record for the requester:
So my suggestion would be to utilize the group approval workflow activity, make sure that Wait for is set to "An approval from each group" and then create this new business rule on the sysapproval_approver table.
My only addition to the solution in the above community post is to put a condition on the business rule where source_table = change_request so that this business rule doesn't run on all approvals.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2018 10:46 AM
So to make sure I have this strait. You have 2 groups that have approves in them. You need at least 1 approver from each group to approve as long as they are not the requester. Is this correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2018 10:54 AM
Hi, Yes - that is correct. To make matter worse, my addQuery user.sys_id != current.requested_by; also does not work as it should.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2018 11:01 AM
Ok sounds like you have the condition for approval set to anyone to approve in the user approval. I think you will need to change that to condition based on script.
I have never actually done of these but it looks like you can get the number of approvers. I'm not sure how easy it would be do figure out if it was be one user form each group. I'm wondering if it might be easier to use a run script to pull the groups first and save it in a workflow.scratchpad variable. Then set two separate approvals one after the other.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2018 11:06 AM
That seems rather complicated! I have already played around with trying to exclude users in the Group approval, but I don't think that's possible. The group block runs the condition that says 'wait for an approval from each group' and the above script works fine, however, unable to block 'requested_by' user from doing the approval. Can that condition somehow be achieved in the Group block?