I want to close all child incidents before closing parent incident, if any one child incident not closed the parent incident should not be close?

VENKATESH PUNGA
Tera Contributor

I want to close all child incidents before closing parent incident, if any one child incident not closed the parent incident should not be close? 

1 ACCEPTED SOLUTION

vinothkumar
Tera Guru

Hi Venkat,

 

Create an before update Business rule on incident table and add the condition as State changes to Resolved.

 

var rec = new GlideRecord('incident');
rec.addQuery('parent', current.sys_id);

rec.addQuery('state', 'IN', '1,2,3'); // Replace your incident state values like New, Work in progress, etc., except resolved or closed
rec.query();

if(rec.next()) {

gs.addErrorMessage("There is an active child incident, please resolve the child incident, before closing parent');

current.setAbortAction(true);
}

View solution in original post

5 REPLIES 5

LK11
Mega Expert

Hi,

I have a similar requirement.

When a child incident is created, the parent state is work in progress read-only.  When all the child incidents are completed, the parent state should be editable.  How can I do that?

I set the state to read-only using a UI policy.