MSCThrough interactions with our customers who have shown an interest in System Center Service Manager (SCSM) 2012, we have noticed the need to be able to share data stored within SCSM with other systems. An example of this could be an external ticketing system that is used outside of SCSM, and a need exists to share incident data from SCSM to that external system. Using SCSM and System Center Orchestrator (SCORCH), we have the ability to take incident data directly from the SCSM console and send that data to an outside data source by using a SCORCH runbook. In this example, we will showcase the moving of data from a SCSM incident to a table in an external SQL database. The SQL database is being used just as an example to showcase the moving of data, but through integration with the API’s of an external application, this data could be fed directly into a compatible application’s interface.

We will enable this capability using the open source program Orchestrator Remote Tools 2.51, available from Microsoft’s CodePlex website: http://orchestrator.codeplex.com/releases/view/76983
Orchestrator Remote Tools provides a way to launch Orchestrator runbooks remotely from a UI or a command-line. In this example with SCSM, we are using the command line version of this utility to integrate with a custom SCSM task.

Import the SC2012_Service_Manager_Integration_Pack into your SCORCH environment to allow for SCSM specific runbook activities

Create a new runbook that will take in the data from the SCSM ticket and manipulate or transfer the data as desired. In this example, we are simply saving fields from the SCSM incident into a table in a SQL database.

Runbook Example

In our Initialize Data activity, we are pulling in the IncidentID for our SCSM incident.

We then use the SCSM defined activity Get-Object to pull the details from the SCSM incident into SCORCH. In this example, we also check to make sure that the incident has not already been closed in SCSM.

We include some logic in case the Incident ID was not found or was already closed. This information could be included in an email notification if it was desired.

If we do find that we were able to locate the Incident ID, we continue forward.

Now that the incident has been pulled in through the previous activity, we can reference some of the incident fields and perform operations against them. In this case, we are taking the Description, DisplayName and Title from our incident and saving them to a table named Table1 in a database. It is at this point in the runbook that you could make changes to decide what data to collect from an incident, and where to send the data. We are simply choosing to save the data to a SQL table as an example.

Our end goal is to be able to take this

And through a button in our SCSM console, send the data to an external application

Through the simple click of this button, our data is delivered to our external source, in this case a SQL database.

To perform these tasks using SCSM and SCORCH, we need to do the following:

Download and extract Orchestrator Remote Tools http://orchestrator.codeplex.com/releases/view/76983
Copy the tools to a location on your SCSM Management Server – ex. C:ORT

Launch ORTUIGenerator.exe to generate a policy_template.xml file, which will include information about the runbook we want to execute

Click OK to the following message

Specify the connection settings to your SCORCH environment and click Save

Browse the runbook menu and select the runbook you would like your custom SCSM button to call, then select “Get details for the selected runbook”

Select “Create Runbook Launcher configuration file”. This will create a new file, policy_template.xml in the same location you are running ORTUIGenerator.exe from. We will refer to this XML file in the command we use within our SCSM task.

Close out of ORTUIGenerator.exe

Within the SCSM console, select the Library tab and select Tasks.
Right click Tasks, and select Create Task.
Click next to the “Before you Begin” screen.
Give your task a name, ex. Send Incident to External System
Select Incident for your target class
Create a new management pack to store this Task

Click next. For Categories, select Incident Management Folder Tasks and Incident Support Groups Folder Tasks.

Click next.

For the command line, enter the full path to the file. EX. C:ORTORTRunbookLauncherCLI.exe

Under Parameters, type in the following: /ORTXML=C:ORTpolicy_template.xml /IncidentID=

This will force the command to use the XML file that you previously created, and has a switch to add in the dynamic value for our incident id. With your cursor just to the right of the = character, select the insert property button and select Work Order ID.

Doing so will enter the following text after the = character: $Context/Property[Type=’CustomSystem_WorkItem_Library!System.WorkItem’]/Id$

This will set Parameters to the following: /ORTXML=C:ORTpolicy_template.xml /IncidentID=$Context/Property[Type=’CustomSystem_WorkItem_Library!System.WorkItem’]/Id$

Leave Working directory with the default: %windir%system32

Click the checkbox to “Log in action log when this task is run”

Click next. Review the summary, then click create to create the task. It may take a few minutes to create the task depending on system load. The task wizard completes. Click close.

You will now see the task you just created as an available task.

Click on Work Items and select an incident.
Select the Send Incident to External System button to kick off the workflow to send incident details for the selected incident to the external system.

Orchestrator Remote Tools is called, and passes the Incident ID into the SCORCH runbook that we defined in the policy_template.xml file

We can see above that the Incident ID was sent over to the SCSM Incident to SQL runbook, and SCORCH will now begin processing whatever steps we have defined in our runbook.

If we look to our SQL table, we should now see a new record added for our incident. As we mentioned before, you can use the process outlined above as a template and make changes to decide what data to collect from SCSM and where to send that data based on your needs.

 

The runbook that was used in this example can be downloaded from the following url:

Orchestrator Runbook Download