set incident status to 'hold' when problem is created from incident

Prasanth Alapa1
Kilo Contributor

Hi,

my criteria is to create a problem from an incident and when doing so,incident state has to change to 'hold' and when the problem is resolved   the incident state should also change to resolved.

Thanks in advance!!!!

1 ACCEPTED SOLUTION

dvp
Mega Sage
Mega Sage

1. Updated create a problem ui action on incident .. to change the state to Hold



2. Write a business rule on problem when the state of problem changes to resolved, update the related incidents.



You might also need to consider the scenario when the problem is tied to an incident manually, update the incident state to hold


View solution in original post

5 REPLIES 5

dvp
Mega Sage
Mega Sage

1. Updated create a problem ui action on incident .. to change the state to Hold



2. Write a business rule on problem when the state of problem changes to resolved, update the related incidents.



You might also need to consider the scenario when the problem is tied to an incident manually, update the incident state to hold


hi,


        1. i have created a form context menu "create problem" and this is absolutely working fine.Thanks for the info Dvp. I need state of the incident to be changed to 'on hold'(of course,i wll add that to the choice list) when i clicked 'create problem ' or when the problem form which is created from incident loads.



        2.   business rule to change the state...any sort of sample snippet will be helpful




thanks in advance!!!!!!


Form context menu's also belong to UI action table only.. search by the name




Here is OOB Busienss rule that does that


SNC - ITIL - Close Related



var incident = new GlideRecord("incident");


  incident.addQuery("problem_id", "=", me.sys_id);


  incident.query();


  while (incident.next()) {


      if ( incident.active == true ){


          var msg = "Incident " + incident.number + ' closed based on closure of problem '+me.number;


          gs.print(msg);


          incident.incident_state = YOUR_State_value;


          incident.active = false


          incident.comments = msg;


          incident.update();


      }



}



Also run this rule only state changes to resolved


Hi dvp,


                        Thanks for the info.


                        i have created a form context menu "create problem" and this is absolutely working fine.Thanks for the info Dvp. I need state of the incident to be changed to 'on hold'(of course,i will add that to the choice list) when i clicked 'create problem ' or when the problem form which is created from incident loads.






thanks in advance!!!!!!