Triggering "Run .Net Script" Activity in Orchestrator Runbook

jansi rani krishnan 601 Reputation points
2021-05-26T17:06:58.14+00:00

This is with reference to my earlier question thread "SCSM Bi-directional Integration with ServiceNow"

I am working on another Runbook which contains only two activities as below.

  1. Run .Net Script (Receives the updated information from ServiceNow and converts to the suitable format in order to update)
  2. Update Object (to update in the incident form)

Is there a way where "Run .Net Script" activity gets automatically triggered when we receive the request from SNOW?

Using the Runbook GUID, I can give the SNOW team an endpoint URL to establish the E-bonding (Example: http://<servername>:81/Orchestrator2012/Orchestrator.svc/Runbooks(guid'5f8dc20a-8205-47c5-8a34-6d6a0646892e'))

In order to make ServiceNow send me a request, I need to share them a request and response structure from SCSM end.

Presently, I am unaware of how to retrieve a request and response structure from the Runbook.

I totally struck at this point in implementing the integration bi-directional.

Your inputs will greatly help me to proceed forward.

Regards,
Jansi

System Center Orchestrator
System Center Orchestrator
A family of System Center products that provide an automation platform for orchestrating and integrating both Microsoft and non-Microsoft IT tools.
217 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 98,626 Reputation points MVP
    2021-05-29T08:32:29.387+00:00

    Hi @jansi rani krishnan ,

    you have to specify all the input properties in the ´Initialize Data´ activity (IncidentID, Status, AssignedTo, Classification, Source, ......).
    The IncidentID is the IncidentID in SCSM to find the object in SCSM for update.
    These parameters can be used in the HTTP POST request to the Orchestrator WebService.

    The output of the ´Initialize Data´ activity are the properties with the values posted by the HTTP POST request.
    From there you can get the SCSM incident object by using the IncidentID and update the values of the incident object with values of the other properties (Status, Source, ....)

    There is no need to parse any XML structure if SNOW is calling the Orchestrator Web Service by the URL with values of the input parameters of the ´Initialize Data´ activity.

    The second option is to use the SCO Job Runner: https://techcommunity.microsoft.com/t5/system-center-blog/cool-tool-new-command-line-utility-to-start-a-runbook/ba-p/345890
    This is an easier way. The Orchestrator WebService will be called by the SCOJobRunner.exe with parameters to trigger the runbook in Orchestrator.
    SNOW will start the SCOJobRunner.exe with the required parameters (runbook guid and input parameters). The parameters are defined in the ´Initialize Data´ activity liked described above.
    No need to parse any XML structure in the runbook. It's working the same like described above.
    The difference is just the method to call the Orchestrator WebService.
    First option: Call by an HTTP POST request URL of Orchestrator in SNOW
    Second option:: Run the SCOJobrunner.exe with parameters triggered by SNOW

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


2 additional answers

Sort by: Most helpful
  1. Andreas Baumgarten 98,626 Reputation points MVP
    2021-05-26T17:31:42.887+00:00

    Hi @jansi rani krishnan ,

    we had this topic already:
    https://learn.microsoft.com/en-us/answers/questions/368916/creating-runbooks.html

    There are links with the different solutions in the thread.

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


  2. Stefan Horz 3,461 Reputation points
    2021-05-26T19:01:58.09+00:00

    Hi,

    you can trigger a Runbook and get the Job information using Orchestrator Web Services with REST: https://techcommunity.microsoft.com/t5/system-center-blog/starting-runbooks-and-stopping-jobs-using-the-system-center-2012/ba-p/345024

    Regards,
    Stefan

    0 comments No comments