Multiple Groups approval in workflow

brown9394
Tera Expert

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!

1 ACCEPTED SOLUTION

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

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:

https://community.servicenow.com/community?id=community_question&sys_id=9241532ddbdcdbc01dcaf3231f96...

 

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.

View solution in original post

13 REPLIES 13

So my second suggestion was to get the groups so you could do separate user approvals and use a script in the approval to remove any users that need to be.  So I would get the info for what groups I need then do a user approval and pull the required user from group 1.  Then once someone in group one approves send it to a second user approval and pull the required users from group 2.

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

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:

https://community.servicenow.com/community?id=community_question&sys_id=9241532ddbdcdbc01dcaf3231f96...

 

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.

Hi Michael, Thanks for the info! My only concern is that I have 6 different approvals through out the workflow for change_request.

- How do I limit requested_by to not do their own approval at a specific approval?

- And that raises another question, Let's say I do use the BR as is adding of course the soure_table = change_request condition, will it remove requested_by from ALL the approvals? The reason I ask this is because at various stages of approvals, we have conditions built in the User blocks to remove requested_by/for, etc. Maybe we need to rethink the logic, if a simple BR can prevent requested_by from doing an approval no matter what part of the group they are in. 

 

I think Michael's BR idea does just that.  It will prevent the requested_by from being an approver on any approval step.

Yes, tested this out and it works as expected. I was able to add in additional logic to only remove the user at a specific stage.