Creating a view to display the problem records created in the last 30 days

Views are used everywhere in the Service Manager console to display objects of a certain class and for a given criteria. If you take a look at the views for the problem management process, there are a few predefined views, as follows:

  • Active Known Errors
  • Active Problems
  • Closed Problems
  • My Problems
  • Needing Review
  • Resolved Problems

These are all good and useful views, but there's a good chance that you might want to create a couple of additional views. For instance, you might want a view that shows all the problem records that have been created in the last 30 days, regardless of their status.

Getting ready

Make sure that SCSM is up and running and that you have sufficient privileges to create a new view.

How to do it...

Here's how you create a view to display all the problem records that have been created in the last 30 days:

  1. Open the Service Manager Console and go to Work Items.
  2. Select Problem Management.
  3. Click on the Create View task in the task pane.
  4. Enter All Problems last 30 days as the name of the view.
  5. Enter This view displays all Problem Records created in the last 30 days as the description.
  6. Select a management pack to store this view in.
  7. Go to the Criteria section, click on the Browse button, select the Problem class, and click on OK.
  8. In the search field for Available properties, enter Created date.
  9. Check the Created date property and click on Add.
  10. Created date should now appear in the Criteria section. Click on the drop-down box next to Created date and select is greater than or equal to.
  11. Now check the relative checkbox and enter [now-30d]in the text field, as shown in the following screenshot:

    How to do it...

  12. Next go to the Display section and make sure that the only columns that are selected are as follows:
    • Created date
    • Id
    • Known Error
    • Status
    • Title

    Tip

    There are two properties in the display section named ID. One of these is the actual ID of the problem request, and the other one is the internal ID (also known as GUID). Unfortunately, there is no good way to tell these apart, so if you select the wrong one, just edit the view and select the other ID instead.

  13. Click on OK to create the view.

How it works...

The view will display all objects for the given class and criteria. In our example, we created a view targeting the Problem class. We used a special criteria property, now, for creating the view, which is known as a token. Because we used [now-30d], SCSM will deduct 30 days from the current date and use that as the criteria when querying the database.

There's more...

Views can be created for any class in the system using a similar series of steps. You could even create a view to display all incidents where the affected user belongs to the marketing department. In order to create such a view, you would have to base your view on a combination class instead of the regular incident class since we are traversing relationships.

When creating your view and choosing which class to target, click on the drop-down menu at the top-right corner and choose Combination classes. You will then get a list of all available combination classes. If you would like to create the view for all incidents where the affected user belongs to the marketing department, you could base your view on the incident (typical) combination class, for instance.

There's a catch in using Combination classes for your views; the bigger your combination class is, the more complex the SQL query behind the scenes are and the more objects will have to be retrieved from the database, which in turn decreases the performance for loading the view. Because of this, you should avoid using Combination classes if it's not necessary, and if you need to use them, always use the narrowest one. Using too large Combination classes in views, queues, groups, and so on is one of the most common mistakes when configuring SCSM and can greatly decrease performance.

Tip

Combination classes are actually another name for type projections, and the term type projection is far more common when searching for more information regarding this on the Web.

Available tokens in SCSM

There are three tokens available in SCSM:

  • [me]
  • [mygroups]
  • [now]

All three tokens can be used when creating views. If you take a look at the views displaying My Incidents or My Problems, you can see how these tokens are used. Tokens cannot be used for anything other than view criteria.

See also

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.109.141