In this post we are going to take a look on how to add a reviewer to a Review Activity from Orchestrator. This is useful for occasions where you might want to add reviewers based upon the information specified in the parent Work Item. For instance, if a Change Request is related to a certain Business Service, you might want to add the owner of that Service as a reviewer for approving the actual Change Request.
I know there are some blog posts out there that describe this as a small step of the actual post, but I feel like this topic deserves a dedicated post, so here we go.
The first time you are attempting this you will probably try to do something like this:
This might seem right, but it won’t work. Why? Let’s take a look inside Service Manager to figure it out.
Here’s a picture of a Review Activity without any reviewers. This is the object that we are retrieving in the “Get Object (Review Activity)” step in the runbook above.
So let’s add a reviewer to this Review Activity by pressing Add. When doing so we are presented the following form.
This is a form for a Reviewer object – and the reason to why the runbook displayed in the beginning of the post won’t work. You see, the Reviewer object is used to store properties such as “Has veto”, “Must Vote”, “Comment”, “Voted by” etc. We are actually adding a reviewing user to the Reviewer object, not the actual Review Activity.
The relationship between all these objects goes like this:
Work Item —-> Review Activity —-> Reviewer —-> User
Let’s add the Relationship names to this as well:
Work Item — “Contains Activity” –> Review Activity — “Reviewers” –> Reviewer — “Is User”–> User
So with this knowledge, let’s head back to Orchestrator and make a new attempt to add a reviewer to our Review Activity.
In the image above you will see that we need to use another activity “Create Related Object”. This activity is used to create the Reviewer object (bear in mind that every reviewing user needs their own Reviewer object!). So first of all we need to retrieve the user which we want to add as a Reviewing user. Then we need to retrieve the Review Activity in which we want to add our Reviewing user. Now we need to create the Reviewer object and then create a relationship between the Reviewer object and the Reviewing user. This is how all this is configured:
Get Object (Reviewing User)
For simplicity I’m just retrieving a certain user – in reality you will most likely have this step much more dynamic, such as the user owning the related Business Service.
Get Object (Review Activity)
Again, for simplicity of this demo I’m retrieving a specified Review Activity.
Create Related Object (Reviewer Object)
Here’s the step where we are creating the Review Object. You are also able to specify things such as “Has Veto” or “Must Vote” in this by clicking “Select optional fields…”
Create Relationship (Reviewing User)
Finally we add the relationship between the Reviewer Object and the Reviewing User. Note that we are using the “Target Object Guid” from the “Create Related Object (Reviewer Object)” step as the Source Object Guid!
After running the runbook, this is the result: