SLA Complete through business rule

shravan3
Kilo Expert

Hi,

We have a requirement to move the incident state to inporgress when an ITIL user is creates the ticket.

We have written a business rule on incidnet table . But It is not working, this business rule is conflicting to attach SLAs to the incident .  

Next we have written on Task SLA table on insert of SLA , moving state to In progress. This is working but it is also conflicting to OOB business rule

"Run SLA" and SLA is moving to complete state.

Please let me know how to move the state to Inprogress when an ITIl user creates the ticket.

Thanks & Regards,

Shravan Kumar

12 REPLIES 12

shravan3
Kilo Expert

Hi,



Below is the code of that busineess rule after insert and update - task sla


condition: current.planned_end_time.changes() && !current.planned_end_time.nil()




var inc = new GlideRecord('incident');


inc.addQuery('sys_id' , current.task);


inc.query();




if(inc.next()){



  if((current.sla.u_sla_type == "response") && (current.stage != "cancelled")){


  inc.u_response_deadline = current.planned_end_time;


  inc.opened_at = current.start_time;



  }else if((current.sla.u_sla_type == "resolution") && (current.stage != "cancelled")){


  inc.due_date = current.planned_end_time;


  }


  inc.update();



}




Thanks


Have you tried changing its order above the new business rule?



I believe this should run once SLA is completed.



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


shravan3
Kilo Expert

Yes i have tried the changing its order above new business rule.



It is not populating the above the business rule field after completion of SLA



Thanks,


Shravan Kumar