close child incident state after parent

Ravi Borade
Giga Contributor

I want to set child incidents state to close after parent state is closed by using business rule 

here is my approach tell me where I'm wrong

find_real_file.png

find_real_file.png

 

1 ACCEPTED SOLUTION

Mohith Devatte
Tera Sage
Tera Sage

Hello @Ravi Borade ,

PLEASE replace your script like below.

Child incidents are stored on parent field so you need to glide record with parent field

And also change your condition from state is closed to  stage changes to closed

var gr= new GlideRecord('incident');
gr.addQuery('parent',current.sys_id);
gr.query();
while(gr.next())
{
gr.state=7;
gr.update()
}

Please mark my answer correct if it helps you

 

View solution in original post

13 REPLIES 13

not working at all

@Ravi Borade  can you share the script and condition of BR once?

check attachment

@Ravi Borade PLEASE CHANGE THE CONDITON TO 

STATE CHANGES TO CLOSE INSTEAD OF STATE IS CLOSED AND TRY

dude your code worked but I've a funny situation