Passing Data from one Runbook to another
Hi Guys,
I have a User Account Creation Runbook that is triggered via the the portal, when HR submits a request. The requires an approval. We have a Runbook that fetches any Activity that has a reviewer and emails the reviewer (Email Reviewer).
Is there a way to setup a Runbook (Email Reviewer) to fetch the data submitted in Another Runbook (by HR in User Account Creation Runbook)? We'd like to add these data to the email sent to reviewer for them to review it straight from the email, instead of them going to Service Manager Console/Portal to see what HR entered.
Many thanks in advance.
Answers
@Vik You could write the data into the Description of the Runbook Automation Activity and then get that Activity in your next runbook - Then you just pass the description from the first runbook to the mail, which you send out in the second one.
You would have to get the activity by Child ID. I can help you if you need a script for that.
Hi @Simon_Zeinhofer , that would be great, thanks.
Hello @Vik , this is the code:
SMlets have to be installed on the server you are running the script (your SCO runbook server)
On top of the code you have to insert values from your environment, the Service Request and the Child ID you are looking for.
You can just create a new .net activity in your sco runbook, copy the script and use the 3 variables at the bottom inside your published data. The last one is the description, which you want to use in your other runbook.
If you need a script for getting all the child IDs from a SR template, I have written a little script, which might be helpful:
The code above gives you all the child IDs from your template (The name of the template has to be written on top in the variable $templateName")
Smlets is fundamental here as well.