Prevent closure of parent incident if any of the child tasks(problem, change, RITM) are open
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2023 03:05 AM
Hello All,
Suppose there is one parent incident which has 4 child incidents, those 4 child incidents has their own child task associated with them like problem,change, RITM and so on till n number of the branches.
I would like to prevent closure of parent incident if any of the child records are open in all the branches.
How Can I achieve this?
Kindly give hint.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2023 03:39 AM
Hi Udit,
Please check this thread if this could help.
Prevent an incident/problem from closing while tasks are open
Mark Correct and Helpful if it helps.
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2023 05:14 AM
This link does not help,
I need to check for all the task extended table.
Kindly help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2023 05:51 AM
Hi Udit,
You can try this then
1. Create a before update business rule on incident table
2. In condition Select state changes to closed
3. In the script try this script
(function executeRule(current, previous /*null when async*/) {
var openTasks = new GlideRecord('task');
openTasks.addQuery('parent', current.sys_id);
openTasks.addQuery('active', true);
openTasks.query();
if (openTasks.next()) {
gs.addErrorMessage('There are open tasks on this incident. Please close them before closing the incident.');
current.setAbortAction(true);
}
})(current, previous);
Mark Correct and Helpful if it helps.
***Mark Correct or Helpful if it helps.***