- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2019 01:04 PM
Hi,
We are trying to build custom related list for Problem Management. We need to display Incident outages under problem for all related Incident to the current problem.
Custom field was added cmdb_ci_outage table to refer related Incident. Lets say Problem has 3 Incident related and each Incident has 1 outage record so Incident outage related list on problem should show 3 records.
We have added custom script and created relationship for Incident outage. Here the screen shot.
But somehow it returns only one outage record related to first incident in array. Any other way to achieve this.
We dont want to create duplicate records of outages in cmdb_ci_outage table for Incident and problem.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2019 02:27 PM
Corrected the code and its working now.
var incidents = [];
var incs = new GlideRecord('incident');
incs.addQuery('problem_id',parent.sys_id);
incs.query();
while(incs.next())
{
incidents.push(incs.getValue('sys_id'));
}
current.addEncodedQuery('u_impacted_recordIN'+ incidents);
gs.info(incidents);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2019 02:27 PM
Corrected the code and its working now.
var incidents = [];
var incs = new GlideRecord('incident');
incs.addQuery('problem_id',parent.sys_id);
incs.query();
while(incs.next())
{
incidents.push(incs.getValue('sys_id'));
}
current.addEncodedQuery('u_impacted_recordIN'+ incidents);
gs.info(incidents);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2021 10:57 PM
How does your incident and problem, cmdb outage forms look like ?