- 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 12:56 PM
What happens with group approvals is code loops through the members of the group and creates individual approval records for each member. The business rule I suggest will look for a situation where the approver matches the change requester and if so, it aborts inserting an approval record for that person since he/she cannot approve their own record.
Of course additional conditions can be added to this business rule to allow it in certain cases if required. But the nice thing about this solution is it will work across all of change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2018 01:18 PM
Thanks! this worked as expected. Also, was able to add in a condition to check for approval type to only do it on a specific approval. However, I can see it being useful across all of change as you stated. Much appreciate this easy solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2018 02:09 PM
Nice, glad it solves your requirement!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2023 12:34 AM
Hi MIchael,
Good day and I hope you are well.
I am in need of the same setup but the link in provided no longer works. I would appreciate if you could repost the link or alternative link.
Thank you in advance.
Regards,
Chin4