question

jansiranikrishnan-1796 avatar image
0 Votes"
jansiranikrishnan-1796 asked jansiranikrishnan-1796 commented

Invoking Orchestrator Runbook through a web-service call using Powershell code

Hi Andreas, StefanHorz,

I am triggering a Runbook (which creates an incident in SCSM) through a web-service call using a PowerShell code. In real scenario, this Runbook would be triggered by a third party application (Service-Now).

As soon as when the Runbook gets triggered, it returns the response even before it completes its execution. A sample response is attached below.

164389-image.png

When we query the Runbook with Job GUID (which is unique for each instance), we can get the status as completed. Actually am facing an issue wherein the third party application receives this response and they are not sure if the web-service call was successful by seeing the status as "pending". Unfortunately they cannot query the Runbook job GUID as they are not in the same network where Orchestrator servers are running.

Is there a way where we configure the Orchestrator Runbook to send the response only after it completes the execution?
Please suggest any solution. I am totally stuck with this work. Any pointers are highly appreciated!

Regards,
Jansi

msc-orchestrator
image.png (63.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered jansiranikrishnan-1796 commented

Hi @jansiranikrishnan-1796 ,

the only option I can see at the moment:
Add an activity in the runbook at the end, for instance a "Run .Net Sctipt" activity, that will call the "external web-service" and "send" the status "Runbook is done" with the "status message" = "successfully" or "failed". You can add more details if required like "RB Job GUID" or whatever.
This way the "external web-service" could handle "what's next" based on the status.


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

Regards
Andreas Baumgarten

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Andreas,

Do you mean to say that to call Service-Now web-service? In this case, SNOW team has to create new API to accommodate the customized fields, so that they can process the status messages and update in their system. Am I correct here?

Also, in this case, SNOW team has to ignore the initial default response sent by Orchestrator web-service with pending status. And they need to consider the second request as the response to the first transaction. Please confirm.

Regards,
Jansi

0 Votes 0 ·
AndreasBaumgarten avatar image AndreasBaumgarten jansiranikrishnan-1796 ·

Hi @jansiranikrishnan-1796 ,

that is exactly what I mean.

If you need to provide "feedback to ServiceNow" that can't be send the default way you have to find a way around to do this.
At least that's the way I am doing this with this kind of requirements I get from customers. I am not involved in any SNOW scenario but I got similar requests to connect with other applications.


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

Regards
Andreas Baumgarten

0 Votes 0 ·

Hi Andreas,

Okay. Got it. Thanks for your immediate response.

Regards,
Jansi

0 Votes 0 ·