Resetting an SLA

Joey Wan Kenobi
Tera Guru

Hi All,

I'm looking for a sensible way to restart this SLA which is used for Incident Acceptance (there is also an SLA for incident resolution):

9-17-2014 11-23-43 AM.png

The reason for which i want to restart it is this:

When a team first gets the ticket, the state is 'open.' If that team changes the assignment group without the state being changed to something besides open, the acceptance SLA will keep ticking. I want a new acceptance SLA to start for the new assignment whenever the assignment group changes on an open ticket.

 

Im not sure if this should be accomplished with:

SLA condition/condition rules

A business rule that will cancel the original SLA

or

someone's brilliant suggestion

 

I recognize that i can prevent changing the assignment group while the ticket is 'open.' However, that is a can of worms that i think will have an effect on data center operations as they frequently assign tickets as they come in from monitoring systems.

 

If you have any feedback, it would be much appreciated.

3 REPLIES 3

marcguy
ServiceNow Employee
ServiceNow Employee

we ended up having a couple of BRs on incident to deal with this:


INCIDENT OLA CONTROL:


Description: If the assignment group is changed when an incident is in the open state then cancel the response OLA for the previous assignment group.


BEFORE UPDATE


condition:   current.assignment_group.changes() && current.incident_state == '1' && previous.incident_state == '1'


script:


(function() {


    var gr = new GlideRecord('task_sla');


    gr.addQuery('u_group', previous.assignment_group);


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


    gr.addQuery('sla.type', 'OLA');


    gr.addQuery('stage', 'in_progress');


    gr.query();


   


    if (gr.next()) {


          gr.active = false;


          gr.stage = 'cancelled';


          gr.end_time = gs.nowDateTime();


          gr.update();


    }


}());




A new one should kick off for the team, the other BR we use is to insert an OLA even if the start condition is not MET i.e. it's been moved straight to in progress, added it below in case it also fits your case:



(function() {


    try {


         


          var gr = new GlideRecord('task_sla');


          gr.initialize();


          gr.task = current.sys_id;


          gr.u_group = current.assignment_group;


          gr.sla.setDisplayValue(_setOLA());


          gr.insert();


         


    } catch(err) {


          var strErr = 'Error in Business Rule: DEV response OLA control'


          + '\n\nError Type: ' + err.name


          + '\nError Message: ' + err.message;


          logIt(strErr, 'debug.incident');


    }


   


    function _setOLA() {


          var priority = current.priority;


         


          if(priority == 1) {


                return 'Priority 1 Response OLA';


          } else if(priority == 2) {


                return 'Priority 2 Response OLA';


          }   else if(priority == 3) {


                return 'Priority 3 Response OLA';


          } else if(priority == 4) {


                return 'Priority 4 Response OLA';


          }


    }


}());


This helped me solved a issue when start conditions dont meet how to trigger OLA's.


surya123
Mega Guru

hi captainbonko,



Did u gt to achieve this? if yes, can you tell how?