How to add a Reviewer to a Review Activity through Orchestrator

September 20, 2012 Posted by Anders Asp

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:

12 Responses to How to add a Reviewer to a Review Activity through Orchestrator

  1. Robert says:

    Great article. In some cases I may have the same person owning two business services that are associated with a change. Is there anyway to stop the same user being populated into the Review Item multiple times?

  2. Aaron says:

    I continue to receive the Source Object Guid is Null or empty when it attempts to Create the Reviewer. Help?

  3. Erwin says:

    I get the same error as @Aaron:
    [c77..b94] is not an instance of class [System.WorkItem.Activity.ReviewActivity]

    please help

  4. Ryan Kolter says:

    I know the answer to both Aaron and Erin’s issues above:

    The blog above specifically is using GET OBJECT and filtering for the Review Activity by it’s ID. I bet Aaron and Erwin are using either Create Related Object or Get Related Object instead.

    Create Related Object and Get Related Object store three GUIDs, not one:

    — SC OBJECT GUID is the GUID of the relationship itself.
    — SOURCE OBJECT GUID is the GUID of the Source (SR for this case)
    — TARGET OBJECT GUID is the GUID of the Target (RA for this case)

    So if you are going to reference your Review Activity’s GUID from Get Related Object or Create Related Object, you want to use TARGET OBJECT GUID, and not SC OBJECT GUID.

  5. news says:

    Asking questions are in fact pleasant thing if you
    are not understanding anything entirely, however this post
    offers good understanding even.

  6. Публикация полезная и нужная. Посмотрел, на сайте присутсвуют и другие полезные статьи. Большое спасибо!

  7. Georgina says:

    Hi to every one, because I am really eager of reading this weblog’s post
    to be updated daily. It contains pleasant stuff.

  8. Mamie says:

    Aw, this was an incredibly good post. Finding the time and actual effort to create a really good
    article… but what can I say… I put things off a lot and never manage to
    get anything done.

  9. google feud says:

    Thanks in support of sharing such a nice opinion, article is pleasant, thats why i have read it completely

  10. Quality articles is the key to be a focus for the viewers to go to
    see the site, that’s what this website is providing.

Leave a Reply

Your email address will not be published. Required fields are marked *