- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2021 01:24 AM
When CI is added to the 'Affected CI' related list on Incident form, this CI does not show the same incident on CI's "Incident" Related List. How can we display the list of incidents where the CI is added as Affected CI?
I tried configuring "Affected by Task" Related List but it is showing the list of incidents where this CI is added on "Configuration Item" field as well. I want the incidents to be listed only for Secondary CIs (that are manually added under Affected CI) and not on the primary CI(Added as a Reference on "Configuration Item" field on INC) as we already have "Incident" related list on CI form which shows this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2021 03:09 AM
Hi,
Can you try creating a new relationship - System Definition > Relationships.
In the new record can you set the name as what you want the related list title to be, the applies to table to be 'Configuration Item [cmdb_ci]' and the queries from table to be 'CIs Affected[task_ci].
In the query with script set the following:
(function refineQuery(current, parent) {
current.addQuery('ci_item', parent.getUniqueValue());
current.addQuery('task.cmdb_ci', '!=', parent.getUniqueValue());
})(current, parent);
This should then give you a related list of all the tasks where the CI is in the affected CI list but excluding the CIs that are in the configuration item field. You could add a further condition to this if you want to restrict to certain task types.
As an example I've got an incident with the configuration item set as '*BOW_IBM' :
I've then manually added '*BUD-IBM' to the affected CIs related list on the incident:
In *BOW-IBM form it does not appear in my new related list but is appearing in the incidents related list as expected:
And then the opposite for *BUD-IBM:
Hope this helps
Thanks
Sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2021 03:09 AM
Hi,
Can you try creating a new relationship - System Definition > Relationships.
In the new record can you set the name as what you want the related list title to be, the applies to table to be 'Configuration Item [cmdb_ci]' and the queries from table to be 'CIs Affected[task_ci].
In the query with script set the following:
(function refineQuery(current, parent) {
current.addQuery('ci_item', parent.getUniqueValue());
current.addQuery('task.cmdb_ci', '!=', parent.getUniqueValue());
})(current, parent);
This should then give you a related list of all the tasks where the CI is in the affected CI list but excluding the CIs that are in the configuration item field. You could add a further condition to this if you want to restrict to certain task types.
As an example I've got an incident with the configuration item set as '*BOW_IBM' :
I've then manually added '*BUD-IBM' to the affected CIs related list on the incident:
In *BOW-IBM form it does not appear in my new related list but is appearing in the incidents related list as expected:
And then the opposite for *BUD-IBM:
Hope this helps
Thanks
Sam