locked
Create a view - All Service Requests that contain a Completed Review Activity RRS feed

  • Question

  • In the Service Manager 2012 console, is it possible to create a view that displays Service Requests, with the view criteria being something like as follows:

    • Service Request status is In Progress
    • Service Request contains a Review Activity where the Review Activity status is In Progress

    My intent is to provide a way for Service Desk Operators to be able to identify requests that are ready for implementation.

    From what I'm seeing in the console, this sort of view is not possible as it appears that any view criteria must be derived from the view's target class.

    Thursday, April 4, 2013 8:04 AM

Answers

  • Nothing like a bit of thread necromancy in the morning.

    It turns out the solution to this question was quite straight forward (once you know where to look...)

    The trick is creating a view based on one of the Service Request combination classes rather than the basic class itself, and then rephrasing my requirement after realising that what I was really after was a view containing Requests that have an In Progress Manual Activity.

    So...open the console, go to Work Items, right click on Service Request Fulfillment and select Create View

    On the General tab, give your view a name and select a Management in which it will be stored.

    On the Criteria tab, click Browse to select a specific object class.  Change the Frequently used basic classes filter to Combination classes then enter 'Service Request' in the filter field.

    Pick the Service Request and Activity class.

    Now when configuring the criteria, you'll notice a little arrow next to the Service Request class. Click on this arrow to expand the node, and select the Contains Activity class.

    Under the Available properties box, enter 'Status' in the search field. In my environment, I got two Status fields. Each corresponds to a specific Activity class. Select both of them and click Add.

    One of the Criteria will look like 'Contains Activity[Activity]Status'. Keep this one and delete the other from the Criteria box. Change the value to 'Completed'

    While we're at it, select the Service Request class and add a criteria for the Service Request Status = 'In Progress'.

    Click on the Display tab and select whatever fields you want to display in this view.  Click OK to save this view.

    Now go to the Administration workspace and select the Management Packs node. Export your management pack that contains your view and open the management pack in a text file viewer. Notepad++ works for me...

    First search for the string that you used to name your view. It will be found towards the bottom of the MP in a DisplayString element in the LanguagePacks XML element. This element will have an ElementID.

    Select the ElementID and search the entire file for this string. You want the instance that resides within a Presentation | Views | View element. From this point, scroll down until you get to a Criteria element. Within the Criteria element you will find the two Expressions that were entered via the GUI. One of the Expressions corresponds to the Service Request.Status=In Progress criteria, the other corresponds to the Activity.Status=In Progress criteria. We will be changing the Activity criteria so that it explicitly refers to a Manual Activity.

    Identify the Expression that has the Property containing the string 'System.WorkItemContainsActivity'. We will be changing the TypeConstraint attribute of this criteria.

    In this line, Replace the string 'System.WorkItem.Activity' with 'System.WorkItem.Activity.ManualActivity'

    Save this file and import the management pack into SCSM


    Tuesday, August 19, 2014 1:03 AM

All replies

  • Maybe this will work for you:

    Extend the Service Request class with a property -> "Review completed" or "Review in Progress"

    Fill in the information by a workflow (Powershell script) or Orchestrator -> On update of Review Activity write property value in the field of SR

    Hope this helps.


    Andreas Baumgarten | H&D International Group

    Thursday, April 4, 2013 7:23 PM
  • Thanks for the advice.  I've been able to extend the Service Request class with a "Review Status" property.

    I'm struggling to find a way to use a Review Activity workflow to update this new property.  A workflow can only apply templates of the same class, and a Review Activity doesn't contain any activities (and hence can't contain a runbook automation activity).  I can't use a Review Activity template to execute a runbook that will update the parent Service Request property.

    Am I missing something here?  Is there a way to get a Review Activity workflow to launch an runbook?

    Friday, April 5, 2013 3:15 AM
  • OK, so I've done a bit more study and digging around.

    To answer my own question, it IS possible to get a Review Activity workflow to launch a runbook...sort of.  To achieve this I've been using an Orchestrator Monitor Object.  The Monitor Object waits for any Review Activity to change status to Complete or Failed, then executes subsequent actions.  (N.B. to do this I'm actually using two runbooks, one for a Completed RA and one for a Failed RA).

    So now I can traverse from the Review Activity to the Service Request.  I just can't see or set my extended property.  Argh!!!

    It was at this point I got distracted from this problem for a few weeks.

    Coming back a little wiser, I started experimenting with creating the view using Combination classes rather than the Simple (default) classes.  Specifically I tried creating the view based on the Service Request and Activity class.

    This class got me closer to where I want to be - I'm able to select criteria based on the Contains Activity objects, but I'm not able to select any criteria that exist only on Review Activities.  When I do I get an error: The Full adapter threw an exception.

    I've also started delving into the black art of MP XML hacking, specifically, attempting to create a TypeProjection that will join Service Requests directly to Review Activities via a TypeConstraint.  Again, no luck, still getting the Full adapter error.

    I have a few other tricks to try (e.g. sealing the MP first, apparently that can help) so I'll have to keep you posted.

    Thursday, May 16, 2013 7:56 AM
  • Nothing like a bit of thread necromancy in the morning.

    It turns out the solution to this question was quite straight forward (once you know where to look...)

    The trick is creating a view based on one of the Service Request combination classes rather than the basic class itself, and then rephrasing my requirement after realising that what I was really after was a view containing Requests that have an In Progress Manual Activity.

    So...open the console, go to Work Items, right click on Service Request Fulfillment and select Create View

    On the General tab, give your view a name and select a Management in which it will be stored.

    On the Criteria tab, click Browse to select a specific object class.  Change the Frequently used basic classes filter to Combination classes then enter 'Service Request' in the filter field.

    Pick the Service Request and Activity class.

    Now when configuring the criteria, you'll notice a little arrow next to the Service Request class. Click on this arrow to expand the node, and select the Contains Activity class.

    Under the Available properties box, enter 'Status' in the search field. In my environment, I got two Status fields. Each corresponds to a specific Activity class. Select both of them and click Add.

    One of the Criteria will look like 'Contains Activity[Activity]Status'. Keep this one and delete the other from the Criteria box. Change the value to 'Completed'

    While we're at it, select the Service Request class and add a criteria for the Service Request Status = 'In Progress'.

    Click on the Display tab and select whatever fields you want to display in this view.  Click OK to save this view.

    Now go to the Administration workspace and select the Management Packs node. Export your management pack that contains your view and open the management pack in a text file viewer. Notepad++ works for me...

    First search for the string that you used to name your view. It will be found towards the bottom of the MP in a DisplayString element in the LanguagePacks XML element. This element will have an ElementID.

    Select the ElementID and search the entire file for this string. You want the instance that resides within a Presentation | Views | View element. From this point, scroll down until you get to a Criteria element. Within the Criteria element you will find the two Expressions that were entered via the GUI. One of the Expressions corresponds to the Service Request.Status=In Progress criteria, the other corresponds to the Activity.Status=In Progress criteria. We will be changing the Activity criteria so that it explicitly refers to a Manual Activity.

    Identify the Expression that has the Property containing the string 'System.WorkItemContainsActivity'. We will be changing the TypeConstraint attribute of this criteria.

    In this line, Replace the string 'System.WorkItem.Activity' with 'System.WorkItem.Activity.ManualActivity'

    Save this file and import the management pack into SCSM


    Tuesday, August 19, 2014 1:03 AM