When any Problem Ticket closed then related incidents should automatically close

Harshad1
Kilo Contributor

When problem ticket closed then related incidents tickets should close automatically

Is there Out Of The Box way to achieve this?

1 ACCEPTED SOLUTION

Prasad Dhumal
Mega Sage
Mega Sage

Hello Author,

Please follow this link

when problem ticket closed then related incidents close automatically - Developer Community - Questi...

Please mark Correct/helpful if applicable, thanks!!

Prasad

 

View solution in original post

9 REPLIES 9

Prasad Dhumal
Mega Sage
Mega Sage

Hello Author,

Please follow this link

when problem ticket closed then related incidents close automatically - Developer Community - Questi...

Please mark Correct/helpful if applicable, thanks!!

Prasad

 

Hello Harshad,

If you want to use OOB Business rule,

@John Zhang has provided better way to do that.

Thank You

johnfeist
Mega Sage
Mega Sage

Hi Harshad,

I'm not aware of any OOTB functionality, but it can be accomplished with a pretty simple After Update Business Rule:

 var incident = new GlideRecord("incident");
  incident.addQuery("problem_id", "=", me.sys_id);
  incident.query();
  while (incident.next()) {
    if ( incident.active == true ){
       incident.setValue("state", IncidentState.CLOSED);
       incident.setValue("active", false);
       incident.setValue("rfc", me.rfc);
       incident.setValue("work_notes", msg);
       incident.setValue("close_code", me.u_close_code);
       incident.setValue("close_notes", me.close_notes);
       incident.update(); 
    }
  }

You can set whatever values for the incident you need in the body.  I wrote this quite a while back and it still works fine.

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Nikita Joshi
Kilo Expert

Hi Harshad Pasalkar,

 

You can refer below code for this.

 

var gr = new GlideRecord("incident");
gr.addActiveQuery();
gr.addQuery('problem_id',current.sys_id);
gr.query();
while(gr.next())
{
gr.state = '7';
gr.close_code = 'Solved';
gr.close_notes = "Related incidents got closed on closing of problem";
gr.update();
}

 

If this solution works for you, please mark it as helpful.

Regards,

Nikita Joshi