People sometimes ask why they can’t include some columns in the views that they want. Here is a common one: Why can’t I add the affected configuration item(s) as a column in my incident view?
In order to understand the answer to this question we must understand the incident data model. An “incident” record is really comprised of the following things:
See this blog post for more information on using type projections in views .
If you want to display properties of the incident object itself, that is pretty straightforward. The columns would simply just display the values of the properties. For example:
ID |
Title |
IR12345 | Printer is broken |
IR12346 | HRWeb is down |
It’s also pretty straightforward to add columns for related objects where the relationship type max cardinality is 1. For example, let’s say we wanted to show the Affected User’s domain and user name.
ID |
Title |
Affected User Domain | Affected User Username |
IR12345 | Printer is broken | redmond | twright |
IR12346 | HRWeb is down | redmond | billg |
We run into some problems when we want to display properties of objects where the relationship type max cardinality is more than 1 though. For example, let’s say we wanted to display the affected configuration items’ display names. If there was only one related configuration item we could simply just display it like this
ID |
Title |
Affected User Domain | Affected User Username | Affected CI Display Name |
IR12345 | Printer is broken | redmond | twright | twright-laptop |
IR12346 | HRWeb is down | redmond | billg | hrweb01 |
But what do we do when there is more than one affected configuration item?
We could do something like this:
ID |
Title |
Affected User Domain | Affected User Username | Affected CI Display Name |
IR12345 | Printer is broken | redmond | twright | twright-laptop; printserver01 |
IR12346 | HRWeb is down | redmond | billg | hrweb01; hrweb02; hrweb03 |
But that is kind of hard to read. It’s also technically challenging given the way the grid data binding works. This also makes it kind of hard to sort or group by the affected CI Display name column. And it would slow down performance.
We could do something like this:
ID |
Title |
Affected User Domain | Affected User Username | Affected CI Display Name | |||
IR12345 | Printer is broken | redmond | twright |
|
|||
IR12346 | HRWeb is down | redmond | billg |
|
This approach is also hard to read and doesn’t use space efficiently on the grid and would get really unusable when there were potentially tens or hundreds of related items.
So, at least for now, you can only use properties of objects that are related by relationship types with max cardinality = 1 as columns in views. That is why you see the Affected User, Assigned To User, etc. relationships in the view creation dialog and not Affected CI.
A few other notes on this… You can see above that the Primary Owner relationship is not included in the list even though it is a max cardinality = 1 relationship type. That’s because this view is targeted at a type projection which only includes those two relationship types. If I wanted to include the Primary Owner column in a view I would need to target the view at a type projection which includes that relationship type. For example if I target the view at the ‘Incident (advanced)’ type projection ( Warning !!) then I will see lots of other relationship types available to me (but they are still all only max cardinality = 1 relationship types!):
Max Cardinality > 1 relationship types can still be used in the criteria part of the view definition though – as long as the relationship type is included in the type projection. For example:
Notice how max cardinality > 1 relationship types like ‘Is Related to Configuration Item’ and ‘About Configuration Item’ are included here so you can use them as criteria for the view.
So – how do you know if a relationship type is max cardinality = 1 or > 1? The easiest way is just to look at the fields on the form that are used for those relationships. For example – assigned to user, affected user, primary owner, etc. all use the user picker which only allows for the selection of a single user:
So – this is a max cardinality = 1 relationship type.
Other relationship types use a list view control like this:
Since you can have more than one item here this is a max cardinality > 1 relationship type.
Since an action log can have multiple entries in it this is also a max cardinality > 1 relationship type:
Hope that helps make it more clear why you can’t add some of the columns you might want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.