When Parent Incident is Resolved all Child incidents are not getting Resolved for Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2019 08:09 AM
Hi All,
I have recently came up with an issue that whenever an Parent Incident is Resolved, related Child Incident/Incidents are not getting Resolved.
Even the OOB Script "Update Child Incidents" is enabled but its not working as expected.
Can anyone let me know if I need to modify the existing script or do I need to configure one separate script for the same.
Its an urgent requirement as too many users are getting impacted.
Thanks,
SNOW@Das

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2019 08:29 AM
What version are you on of ServiceNow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2019 08:37 AM
Kingston
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2019 08:47 AM
Hi Das,
Try with the following business rule.
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('incident');
if (gr.get(current.parent_incident)) {
if (checkIfAllChildIncidentsAreResolved()) {
gs.addInfoMessage('All child incidents are now resolved, resolving parent incident');
gr.incident_state = incidentState.RESOLVED;
gr.update();
}
else {
gs.addInfoMessage('Not all child incidents are resolved');
}
}
else {
gs.addInfoMessage('Current incident does not have a parent incident');
}
function checkIfAllChildIncidentsAreResolved() {
var rec = new GlideRecord("incident");
rec.addQuery("parent_incident", current.parent_incident);
rec.addQuery("incident_state", "!=", IncidentState.RESOLVED);
rec.addActiveQuery();
rec.query();
// Check if there are any unresolved child incidents associated to the parent incident
if (rec.hasNext()) {
gs.addInfoMessage('There is an unresolved child incident');
return false;
}
else {
gs.addInfoMessage('All child incidents are resolved');
return true;
}
}
})(current, previous);
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2019 08:50 AM
Hi,
Can you post some screenshots for the BR to be configured. And also let me know the ORDER what should be given?
Thanks..