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:
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.
Make sure that SCSM is up and running and that you have sufficient privileges to create a new view.
Here's how you create a view to display all the problem records that have been created in the last 30 days:
[now-30d]
in the text field, as shown in the following screenshot:
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.
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.
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.
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.