Home General Discussion

Orphaned Activities?

Jason_MeyerJason_Meyer Customer Advanced IT Monkey ✭✭✭

Our Cireson Portal implementation is in about year six now. We are using more and more 'activities' with Service Requests as we get our Request Offerings designed that automatically builds them so monitoring the status of these Activities is becoming more formal. One thing that I've noticed is we have a number (around 500) Activities that seem to be orphaned from active requests. They are accessible in our SSRS 'archive' environment but no longer accessible via the Cireson portal.

I would like to clear these Activities out somehow, so that our reports/metrics are accurate.

How can I do this? Powershell?

Answers

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭

    PowerShell?

    Yes. 😁


    But in all seriousness, when you say orphaned Activities what specifically do you mean? Are they Activities...

    • In SCSM with no Parent Work Item?
    • Pending, but the Parent Work Item is Cancelled/Failed?
    • Something else?
  • Jason_MeyerJason_Meyer Customer Advanced IT Monkey ✭✭✭
    edited September 2021

    Yes, they are MAs, probably some RAs as well. They have no associated/parent work item in the system.

    Some are pending, some are 'in progress'. I don't think any are cancelled/failed.


    My guess is early in our deployment there was some database issue where some database surgery was done and I think the parent work items were deleted. Just a guess. I'm not the admin of our system, just trying to help resolve an issue.


    EDIT: These MAs/RAs are in our data warehouse.


    Thanks Adam!

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    edited September 2021

    If they are in the:

    • Operational DB, you can use PowerShell, make some edits, and then they'll float their changes into the DW
    • Data Warehouse only because they have been groomed out of the operational DB, then your options are either a lot of surgical work which won't be supported by Microsoft (or at least not without a case with them) or you need your adjust your reports to ignore Activities that don't have Parent Work Items.


  • Jason_MeyerJason_Meyer Customer Advanced IT Monkey ✭✭✭

    Appreciate the info Adam.

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    edited September 2021

    The PowerShell for making these edits, I can certainly construct on the fly. But your report queries sound like you need some INNER JOINS to ensure you're only capturing Activities + Parent Work Items. I'd have to see it to really help on this front.


    Manual Activities with a Status of In Progress and Title of "Order Laptop"

    $maClass = get-scsmclass -name "System.WorkItem.Activity.ManualActivity$"
    $mas = get-scsmobject -Class $maClass -Filter "Status -eq '11fc3cef-15e5-bca4-dee0-9c1155ec8d83' and Title -eq 'Order Laptop'"
    foreach ($ma in $mas)
    {
        Set-SCSMObject -SMObject $ma -Property "Status" -Value GuidOfStatusYouWantToSet
    }
    


    You can get a list of Activity Status enums with the following PowerShell so you could substitute the GUID above:

    Get-SCSMEnumeration -name "ActivityStatusEnum" | select displayname, id
    


    Just make sure before you mass update a bunch of Manual Activities that the $mas variable contains the Manual Activities that actually need to be updated though!

  • Jason_MeyerJason_Meyer Customer Advanced IT Monkey ✭✭✭

    Had a chance to look at this some more. Rather than 'clear' them out, is there a powershell process to mark these Activities 'skipped' or 'completed'? This would also resolve our issue I believe.

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭

    Yes - the above PowerShell you can use/adapt to shift manual activities to a different status.

Sign In or Register to comment.