Home » Orchestrator » Add a new activity to a existing service request

Add a new activity to a existing service request

A couple of weeks ago I was working on a scenario were we needed to add a review activity to a service request with Orchestrator. Part of the solution for that scenario were a couple of runbooks that I want to share in this blog post. These runbooks adds a new review activity to a existing service request. All runbooks require a input parameter when it starts, the service request ID. These runbooks set the domain admins group as reviewers in the new review activity.

When adding a new activity to for example a service request it is always added as the first activity. If there are already two activities the new activity is added before them, in other words the new activity is the one that will run first. You can control this by working with the sequence ID parameter. The first activity have value 0 and the second have value 1 and so on. If two activities have the same value they will run at the same time. You can update activities already existing in the service request and insert the new activity in any order you need, as the 70.2 runbook do.

This example is built on three runbooks.

  • 70.1. This runbook adds a new review activity to a existing service request. The new review activity is added as the first activity (sequence ID equals 0) and the Domain Admins security group is set as reviewers.
  • 70.2. This runbook is used to update current activities with a new sequence ID. The runbook simple add one (+1) to each sequence ID value. This is because in the example we want to add the new activity as the first activity, as we add one to each existing activity there will no longer be a activity with sequence id equals 0. We can then create the new activity and add it with sequence id equals 0.
  • 70.3. This runbook is used to get current activities and each sequence ID. The result is written as platform events. This runbook is not really needed but it is nice to have to see the current configuration
We should 70.2 first and then 70.1.

 

The result is that a new review activity is created in the service request. Domain Admins are set as reviewers on the new review activity.

You can download my example runbooks here, 20120730_addActivity_Sanitize , please note that this is provided “as is” with no warranties at all.

In this blog post I show how activities in a service request can be updated by a runbook activity, for example dynamic approval steps.


9 Comments

  1. I pay a visit daily some web pages and blogs to read articles, however this website presents quality based writing.

  2. Hi, I can’t seem to get the my sequence ID to increase as per the details provided above =[SUM({xxxx.SequenceId\}/,1)]. I have a few manual activities I would like to insert to an existing Service Request but the Sequence IDs are incorrect. I would really appreciate your assitance on this. Thanks.

  3. Hi Anders, cheers for the tutorial. My Reviewer Activity does show up in my service request ok. But it is missing the “RA” initials for its ID. So instead of showing RA12345 it will show just 12345. Any ideas why?

    Thanks

  4. Hi,
    Then you have to look in your runbook where you get the GUID that you use in the Create Review Activity step. Seems like you are trying to add NULL. Add a couple of logging activities and follow your runbook to make sure you have the info you think in and out of each activity.

  5. I cannot get this to work. When I get to the Create Review Activity step I get “[Source Object Guid] is null or empty.” and the runbook fails.

    I am running Orchestrator 2012 SP1 and Service Manger 2012 SP1 as well with the SP1 IP’s

  6. Hi,
    If you create a new service request work item from a service request template, then in the template you can have runbook automation activities. Is that answer to your question?

  7. Hi 🙂
    is it possibile to create a service request object contains a runbook automation activity object?

Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.