A common question I get from clients is, “How do you setup a Review Activity with the affected user’s Manager as reviewer?” Wait a minute, isn’t there a very simple solution to this? Let’s take a look at a Review Activity.
Aha! Do you see it? Bottom right of the image. Isn’t that what this “Line Manager Should Review” checkbox is for? Problem solved!
Well, not exactly. You see, the question specifically asks for the, “Affected User’s Manager”. The problem with the out-of-the-box workflow that targets the “Line Manager Should Review” check box is that it targets the “Created By User’s Manager” as the reviewer.
Note: This out-of-the-box functionality is particularly useful for Change Requests, where during the Risk Assessment stage, the Manager of the “Created By User” is required to approve the Change Request before it moves along to the Planning and Testing stages.
But, again, that is not what the question asked for. So, the out-of-the-box functionality will not quite work for us. So how do we go about answering this?
Well, if you happen to know me, then you will be used to hearing these words, “Orchestrator can do it!”. This mini blog series will cover the following topics to walk you through how to make this happen.
Now, before we start I think it is important to mention that this type of runbook could be accomplished 100 different ways. For this particular Runbook, I am striving for “Ease of Use” by the end user who is putting their SR or CR template together. And that is, simply add a Runbook Automation Activity (called, “RBA – Affected Users Manager Approval”) in the place of the Review Activity, and allow Orchestrator to do the rest.
The first thing we need to do is setup our “Initiate” Runbook. This is the main runbook that is Invoked by SCSM and controls the flow of all Activities and “Function” Runbooks.
Note: These activities are defined in greater detail within the , “Runbook Deep Dive” follow-up post.
The “Initiate” Runbook Invokes two “Function” Runbooks which are split out to simplify the “Initiate” Runbook. Otherwise, we will have a mess on our hands!
The first “Function” Runbook is the “Increment Activity Sequence IDs”. This Runbook is responsible for incrementing the Activity property, “Sequence ID” for each Manual, Review, Parallel, Sequential, and Runbook Automation Activity related to the Service Request. Why do we do this? Here is why……
Each Activity related to a parent Work Item has a Sequence ID (number starting at 0). This Sequence ID tracks the order of each activity related to the Work Item. An activity with a Sequence ID of 0 is the first activity to go “in-progress” once the parent Work Item has been created. Once that activity completes a SCSM workflow increments to the next Sequence ID (1 in this example) and that activity goes “in-progress”. However, if there are two activities with the same Sequence ID, then the SCSM workflow does not know how to handle the situation and neither activity goes “in-progress”. Essentially, the activity chain is interrupted and manual intervention is required. Not good.
During the “Initiate” Runbook, once we “Create Review Activity related to Service Request” the Review Activity is created with a Sequence ID of (RBA Sequence ID + 1). So, if the RBA was the first activity related to the SR (Sequence ID 0) then the Review Activity will be created with a Sequence ID of 1. If there is an existing activity with Sequence ID 1, then we now have a conflict. Thus is why we have this “Function” Runbook to increment all of the Activities related to the Service Request. (note: ignoring any activity with Sequence ID < Review Activity)
The second “Function” Runbook is the “Get Manager”. This Runbook is responsible for getting the properties of the Manager related to the Affected User. This information is returned by this Runbook which is used later by the “Initiate” Runbook in order to add as Reviewer to the Review Activity that is created.
Check out the Runbook posted at Microsoft’s Technet Gallery. Questions? Comments? Please post below, I look forward to your feedback!