Home Powershell Activity

Parent Base Id inside nested Activities

Simon_ZeinhoferSimon_Zeinhofer Customer Advanced IT Monkey ✭✭✭
edited May 24 in Powershell Activity

When I want to get the Parent Work Item from a Runbook Automation Activity with the "System.WorkItemContainsActivity" Relationship, and that runbook is inside an SA or PA, I have use it that way, in order to receive the Service Request:

$ContainsActivity = Get-SCSMRelationshipClass -Id '2da498be-0485-b2b2-d520-6ebd1698e61b'
$relatedSR = (Get-SCSMRelationshipObject -ByTarget $activity -Relationship $ContainsActivity | ? {$_.SourceObject.ClassName -eq 'System.WorkItem.ServiceRequest'}).SourceObject


As I want to exchange more and more Orchestrator Runbooks with PS Activities, I wanted to ask, what happens, when I use the Parant Base Id like this and the PS Activitiy is inside an SA or PA:

Is the property "Parent Base Id" ALWAYS the Guid of the Work Item containing the Activities, or will it return the "real" parent object, in that case the SA or PA, a bit like in the RB Activity.

Sign In or Register to comment.