Feb
01

Views – Filtered by related object properties

By

When creating a view in the Service Manager console you might want to filter the listed objects based on a related object’s property. Since I got a question last week regarding a scenarios like this, I thought I go ahead and describe how this could be done. In this example I’m creating a view tha lists all change requests that are assigned to a swedish user. Follow the instructions below to create such a view:

  1. Start by right clicking on the “Change Management” folder and click “Create view”.Adv_View_Query_1_CreateView
  2. Name the new view, provide a description and select in which management pack you want to store the view.Adv_View_Query_2_General
  3. Click browse in the criteria section and select “Combination classes” in the “View” drop down list. Select a the combination class called “Change Request (Advanced)” and press OK.
    This is the key to success since you want to be able the query a combination class (a type projection) instead of only a simple class. A combination class provides access to related objects and there properties.
    Adv_View_Query_3_ChooseClass
  4. Since you selected a combination class (a type projection) you can now have a search criteria that is based on properties of items that are related to the change request in your view.
    Adv_View_Query_4_Criteria_RelatedObjects
  5. Select the “Assigned To User” in the left pane of the criteria section. Then check the checkbox for the “Country” attribute in the right pane of the criteria section, click the add button and write “Sweden” in the textbox.
    Adv_View_Query_5_Criteria
  6. Select which columns to display in your view and close the wizard.

You’re done!

To test the view, make sure you have a user object with the country value “Sweden” and a change request with this user as the “Assigned To” user.
Note: The same method could be used to list all incidents that has affected user that speaks a certain language

Comments

  1. [...] Originally posted here:  Views – Filtered by related object properties :: Litware [...]

  2. Really nice! Cant belive that we couldn´t find that in London, not even X beers :)

Leave a Reply