Change peer reviewer

Brendan Hallida
Kilo Guru

Hi all,

We have a fairly standard change workflow, which when it gets to the peer review stage, sends an approval to the user that is added to the u_peer_reviewer field.   The peer reviewer then approves or denies the change.

An issue has come up where the person peer reviewing may need to change (this happens more than you would think), however if this stage has already been reached, the peer review is still with the original peer reviewer.

Here is an example of what I mean

1st Peer Reviewer

find_real_file.png

Approvers tab

find_real_file.png

We have changed our peer reviewer because of reasons

find_real_file.png

Approvers tab - as you can see, it still has the first peer reviewer.

find_real_file.png

What is the best way to address this?   Essentially we would like it if the peer reviewer changes field changes, cancel the existing peer reviewer approval and create a new one.

here is our change workflow

find_real_file.png

I hope this explains everything, and any advise would be most appreciated

Cheers,

Brendan

1 ACCEPTED SOLUTION

Ok, I think I got it!



First of all, I hope someone much smarter than me has a more elegant solution. Actually, I don't think this solution is TOO terrible. Here goes.



Everything you have seems right except we need to tell the Approval activity (the one that is running through as Approved even when you roll back) not to consider "Skipped" as "Approved. To do that we have to edit the Workflow Condition. Locate your Approval workflow activity and click on the "Approved" condition.


find_real_file.png



Then, edit the condition line to say: activity.result == 'approved'



Finally, after the rollback, you have to set your State to something like Work in Progress. I find that the rollback and change in approvers is forcing my task state to be Requested, even if that's not a valid state.



Give it a whirl and you should be good to go! I tested the above steps in my instance and got this to work so you should have success with this method.



My instance:



First, the approver is Aada Larsen. I derived this from a field I created on my form called "Approver":


find_real_file.png



Then I change the approver to "Abel Tuter" on my form. I then manually executed the rollback via Background script:


find_real_file.png



Anf finally, in my task record, the approver is Abel Tuter:


find_real_file.png




I hope this helps! If so, mark the answer is helpful and set this post to Answered.



Good luck, Brendan!


View solution in original post

10 REPLIES 10

Karthik Reddy T
Kilo Sage

Hello Brendan,



Refer the below threads may helpful to you.



Change Approvers dynamically



How to assign an Approvals dynamically?



Dynamic Variables for workflow approval


Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.