Close Child Incidents without closing Parent incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2018 12:38 AM
Hello All,
Am new to Servicenow and trying to explore stuff for daily activities. We come across cases where multiple alerts (incidents) trigger for an issue and have to end up creating a parent and linking others to it.
While we investigate on the parent incident, have to close the child incidents. I would need your support on this activity
Child incidents can be in any State (new, in progress) but have to close all without closing Parent
Kindly assist
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2018 10:56 PM
You may create a UI action on the Parent Incident.
On click of the button, close all related child incidents.
You can try with below script in the UI action.
var inc = new GlideRecord('incident');
inc.addQuery('parent_incident',current.sys_id);
inc.query();
while (inc.next())
{
inc.state=3;
inc.close_notes='Closing from parent incident';
inc.update();
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2018 11:17 PM
I have created UI action: Cancel Child Incident with the provided script. However, using the UI action, the Child incident moved to State: On Hold from new instead of Resolve\Close

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2018 11:31 PM
use below. Note the line marked in bold
var inc = new GlideRecord('incident');
inc.addQuery('parent_incident',current.sys_id);
inc.query();
while (inc.next())
{
inc.state=6; //Use 7 for Closed and 8 for Cancelled
inc.close_notes='Closing from parent incident';
inc.update();
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2018 12:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2018 01:58 AM
I have made it available under Form Context Menu, which is working absolutely fine
Can I get a condition added to the script, so that it is visible only to a parent incident i.e. only when the field Parent Incident (under Related records) is having a value