Partager via


Update Service Manager Related Manual Activity Fields with Information from the Parent Change Request – Scenario 1

 

Copy the “Assigned To” field to all Manual Activities in a Change Template.

This can be achieved through creation of a custom Service Manager Workflow, Rob Ford has some samples available here and, through inclusion of an Orchestrator RunBook Automation Activity, Anders Bengtsson has an example here post for Service Requests.

Using a similar technique to Anders we are going to copy the Parent Change Request “Assigned to” Field Value to Child Manual Activity “Assigned to” Fields for use in a Change Request template.

High level steps

  • Design Orchestrator RunBook
  • Deploy the Service Manager Runbook Automation Activity Template
  • Add the Runbook Automation Activity into the Service Manager Change Request Template

Design Orchestrator Runbook

This Runbook is triggered by the Service Manager Change Management Workflow, it is a RunBook Automation Activity associated with a Service Manager Change Request Template.

1

Service Manager 2012 IP Pack Activities used in this Orchestrator Runbook
https://technet.microsoft.com/en-us/library/hh832016.aspx

  • Get Object -> The Get Object activity is used to search for a record based on a set of filtered criteria. The Get Object activity supports incidents, changes, and activities.
  • Get-Relationship Activity -> The Get-Relationship Activity is used to generate a list of objects from two different classes that are related by the criteria you specify.
  • Create Related Object -> The Create Related Object activity is used to create a new Service Manager object that is related to other existing objects either by membership or by a hosted relationship.

In the Runbook below we are going to use the Get-Relationship activities to build a relationship between the Runbook Automation Activity Class and the Change Request Class – this relationship contains the Parent Change Request ID and then build the relationship to the Related Active Directory User and Group Class which holds the AssignedTo value needed to update all related Manual Activities.

Initialise Data – Service Manager RunBook Automation Activity ID is copied to the Databus

 2

Get-object - “Get RBA ID” – RunBook Automation Activity ID instance values are copied to the Databus

3 1 1   

{SC Object GUID = {RBAId from “Initialize Data" }

 

Get-Relationship - “Get Parent CR related to the RBA ID” – Build the relationship between the RunBook Automation Activity and related Change Request and copies to the Databus

4 Get-CR AssigedTo 1

Object Guid = {SC Object GUID from “Get RBA ID”}

 

Get-object - “Get Parent ID” – Gets the Parent Change Request ID and copies to the Databus

5 Get-Parent CR ID 1

{SC object GUID = {Related Object Guid from "Get Parent CR related to the RBA ID"}

 

Get-Relationship - “Get CR AssignedTo Class” – Build the relationship between the Parent Change Request and related Active Directory User or Group and copies to the Databus

Get-CR Assigned To Class      Assignedtoclasspope

Object Guid = {SC Object Guid from “Get Parent CR ID”}

 

Get-object - “Get CR AssignedTo User” – Gets the Active Directory user or Group Value and copies to the Databus.

Get-CR AssignedTo user      AssignedTo user

SC Object Guid = {Related object Guid from "Get CR -assigned To Class"}

 

Get-Relationship - “From CR Get Related MAs” – Build the relationship between the Change Request and Manual Activities and copies data to the Databus

8 

Object Guid = {SC Object Guid from "Get parent CR ID"}

 

Create-Relationship - “Update MA AssignedTo Fields with Parent CR AssignedTo Field Value” – updates each Manual Activity Active Directory User or Group Value

9 

Source Object Guid ={Related Object Guid from "From CR Get Related MAs"}Target Object Guid = {SC Object Guid from "Get CR Assigned to User"}

 

Check in the Runbook
Update Stub

Service Manager Runbook Automation Activity Template

Assumption -> that an Orchestrator Connector has been configured in your Service manager management group. Information on how to implement and configure the Orchestrator Connector available here.

A Runbook Automation Activity template is created in Service Manager and the RunBook ID is mapped to the RBAID string field for use in Runbook Data Initialise Activity.

Highlight the 1.1.0 CR Assign MAs Runbook and from the Task Bar select “Create Runbook Automation Activity Template” Task

11

The Create Template Wizard Launches, in the Name Type 1.1.0 CR Assign MAs RBA and select to Save the Template into a suitable unsealed Management Pack

12

When the Template loads enter the Title: 1.1.0 CR Assign MAs Runbook Activity

13

And Select “Is Ready for Automation”. Then Click on the Runbook Tab and select Edit Mapping in the Parameter Mapping Field

14

From the List of Available properties select Object ID

15

Click Close, Apply then OK to Finish Creation of the Template.

 

Runbook Automation into the Service Manager Change Request Template

More information on how to create Change Request Templates available here & here

Open the Change Request Template and add the RunBook Automation Activity into the Activities Tab.

image

Add all other related Manual Activities as required then Save the Template

Create a Change Request based on the above Template

* Note * Ensure that the “AssignedTo” User is an instance of the “Active Directory User or Group” Class and not type SMInternal user.

Comments

  • Anonymous
    August 19, 2016
    Hello, thanks for the great post!However, I'm getting a "Input string was not in a correct format." when trying to get {RBID from “Initialize Data" }I tried to create a simple runbook with only two first steps and test is with Runbook Tester, when I pass a GUID manually, it still does not work. If I change the {SC Object GUID = {RBAId from “Initialize Data" } filter to {SC Object GUID = {a real GUID}, it works. Any ideas?
  • Anonymous
    August 22, 2016
    Pls disregard my first comment - got my mistake. I copied the value field in the filter from this page - but I should have right-clicked the vallue field and choose the corresponding item!