Home Orchestrator

How to identify rejected scsm service requests

David_JohnsenDavid_Johnsen Customer Advanced IT Monkey ✭✭✭

The back story behind this is pretty lengthy, so I'll just ask the question first:

Is there a way (powershell or otherwise in Orchestrator) to identify failed Service Requests that have failed because their Review Activity was Rejected?

Now for the reason...

I have implemented 2 runbooks,
  • One to find failed Review Activities - this then changes the SR status to Cancelled and skips the outstanding activities
  • The second to find all failed SRs - this then reopens the SR and moves to the Service Desk to investigate 
Both only pick up updated SR's.

I don't want the second runbook to be picking up the SRs that are failed due to being Rejected.


Best Answer


  • Options
    Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    PowerShell is entirely doable. However the unknown here for me is what is your entry point? Specifically...
    • Are they all SRs of a particular "type" (i.e. title, description, area, etc.) or are they ALL failed service requests?
    I ask as it will certainly change the scope of the input in that the pool of work items to plow through will be either all failed or all failed with some additional criteria. I only ask this terms of a "processing time", but once you get your dataset you'll need to do something to the following effect:

    $sr = #get your SR object here
    $RelatedReviewActivities = Get-SCSMRelatedObject -SMObject $sr | ?{($_.className -match "ReviewActivity")}<br>

    So the first line you get have your SR, the second line gets you the related objects to that SR whose class name equals Review Activity. However what I think the problem here is going to be is your two aforementioned runbooks. If this is happening, you're already changing the "shape" of your data which renders my above idea a bit moot. In which case you're going to have to get more creative and turn to Get-SCSMObjectHistory.

    Hopefully I haven't entirely missed you're question?
  • Options
    David_JohnsenDavid_Johnsen Customer Advanced IT Monkey ✭✭✭
    edited June 2017

    Hi @Adam_Dzyacky

    Thanks for the reply, processing time should be fine as the first step (entry point) is a Monitor Object step in the runbook, this just monitors for updated failed service requests.

    SCSMObjectHistory sounds like it might be a good area to explore. I'll take a look.

    It would be all Failed SR's, so I need the powershell to check for rejected RA's.

    Would your PowerShell then be able to go further to check for a rejected status? It's this bit that I'm struggling with.

  • Options
    David_JohnsenDavid_Johnsen Customer Advanced IT Monkey ✭✭✭

    That's what I needed, thanks @Konstantin_Slavin-Bo

    I had tried the get what you've specified, but had got stuck at the bit to check the status, so it was this bit I needed:

     $status = (Get-SCSMObject -Id $RAGuid).Status.Name

    Thank you!

  • Options
    Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭
    Great, happy to help!
Sign In or Register to comment.