Update child incidents information from parent

Jacky_GrossJacky_Gross Customer IT Monkey ✭
Hello,

I am trying to find a way to update the Incident Classification of all the child incidents based on the parent. By default only the Resolution Category and Solution can be updated when parent is resolved.

Is there a way to achieve that by updating workflow or a runbook?
Best regards

Answers

  • Adam_DzyackyAdam_Dzyacky Customer Contributor Monkey ✭✭✭✭✭
    edited June 5
    Yes this is entirely possible with a custom workflow or custom runbook. Given the way this would have to get written in the SCSM Authoring tool I'd suggest a workflow that:

    • Runs every hour or some interval of your choosing
    • Looks for all Incidents whose Parent value is TRUE and that isn't Resolved/Closed
    • Set all of the Children's Classification enum to the Parent's Classification enum
  • Jacky_GrossJacky_Gross Customer IT Monkey ✭
    Hi Adam,

    It seems like it's not as easy as it seems. I cannot get the relationship in order to update the child incidents nor in Authoring Tool nor in Orchestrator. I was hoping that I may reuse the workflow when parent is resolved in order to add the property for Classification but I could not find a way ...
    Other ideas?
    Thanks a lot for your answer.
  • Roland_KindRoland_Kind Partner Advanced IT Monkey ✭✭✭

    Hi,

    by using a powershell script (e.g. in orchestrator) you can use the following approach to get all child incidents from a given parent incident

    $x=Get-SCSMClassInstance -name <your parent incident>

    Get-SCSMRelationshipInstance -targetInstance $x 

    check for relationship id  with this guid da3123d1-2b52-a281-6f42-33d0c1f06ab4 (has parent work item)

    hope this helps

  • Jacky_GrossJacky_Gross Customer IT Monkey ✭
    Hi,
    I got the answer in the end by adapting the script from https://github.com/lazywinadmin/PowerShell/tree/master/SCSM-Get-SCSMWorkItemChildItem and using Orchestrator to monitor and update the objects. I also used the relationship provided by Roland (thanks!).

    Script:

    Function Get-SCSMWorkItemChildItem
    {
     param (
      [Parameter(Mandatory = $True)]
      $inputPWI_guid
     )
     $childWIs_obj = @()
     $inputPWI_obj = Get-SCSMObject -id $inputPWI_guid
     $childWIs_relobj = Get-SCSMRelationshipObject -ByTarget $inputPWI_obj | where{ $_.RelationshipId -eq 'da3123d1-2b52-a281-6f42-33d0c1f06ab4'}
     ForEach ($childWI_relobj in $childWIs_relobj)
     {
       $childWI_id = $childWI_relobj.SourceObject.id.guid
       $childWI_obj = Get-SCSMObject -id $childWI_id
       If ($childWI_obj.ClassName -eq 'System.WorkItem.Incident')
       {
        $childWIs_obj += $childWI_obj
       }
     }
     $GUID = $childWIs_obj.Get_ID()
     $GUID
    }
    Get-SCSMWorkItemChildItem -inputPWI_guid {SC Object Guid From "Monitor Parent IR"}

    Hope it helps for the future. You may update any property of the child incidents from the parent.
Sign In or Register to comment.