
In the last couple of months, I have been busy on some projects involving System Center Service Manager (SCSM), System Center Orchestrator (SCORCH) and Cireson Portal/Asset Management and I had to script a couple of repetitive tasks using PowerShell.
The following solution allows you to retrieve the parent Work Item of an Activity.
This is useful when you are using a Runbook Activity in your workflow that will invoke a Runbook inside System Center Orchestrator.
Example: In the case where you have a Work Item, a Service Request for instance, with bunch of activities (Review Activity (RA), Manual Activity (MA), Runbook Activity (RBA), etc... ). You could have a Runbook Activity (RBA) calling a System Center Orchestrator runbook.
Example: In the case where you have a Work Item, a Service Request for instance, with bunch of activities (Review Activity (RA), Manual Activity (MA), Runbook Activity (RBA), etc... ). You could have a Runbook Activity (RBA) calling a System Center Orchestrator runbook.
From a SCORCH perspective it would be useful to find which Work Item the runbook activity belongs to if you want to perform some actions on the Work Item itself and other Activities.
Example: Edit the Work Item Title, Add a reviewer, Skip any Activities with a particular stage, etc...
Here is a PowerShell function that can just do this job for you: Get-SCSMWorkItemParent.
Example: Edit the Work Item Title, Add a reviewer, Skip any Activities with a particular stage, etc...
Here is a PowerShell function that can just do this job for you: Get-SCSMWorkItemParent.