SLA Does not resume

jyan3
Kilo Guru

I have an SLA whose Pause/Resume functions are based on a checkbox on a catalog task. The checkbox is controlled in the background by a catalog workflow "run script" activity.
It starts off as false and then after a timer based on a user entered date, it gets flipped on. However when the variable gets set to true via the script task, the SLA doesn't resume. If the checkbox is toggled manually it triggers the SLA to check if it should resume. Is there a way in the script task to force the SLA to check if the checkbox is true or not?

 

Edit: I've also tried in the script task force updating, but that doesn't seem to work either

var taskGR = new GlideRecord('sc_task');
taskGR.addQuery('request_item',current.sys_id);
taskGR.addQuery('short_description', 'STARTSWITH', 'OFFBOARDING Update AD/change AD password');
taskGR.query();
if(taskGR.next()){
    current.variables.ad_sla = 'true';
    taskGR.setForceUpdate(true);
    taskGR.update();
    taskGR.update();
}

 

 

1 ACCEPTED SOLUTION

jyan3
Kilo Guru

had to edit the task workflow and specifically set the stage to in_progress and update()

var taskGR = new GlideRecord('sc_task');
taskGR.addQuery('request_item', current.sys_id);
taskGR.addQuery('short_description', 'STARTSWITH', 'OFFBOARDING Update AD/change AD password');
taskGR.query();
if (taskGR.next()) {
    var slaGR = new GlideRecord('task_sla');
    slaGR.addQuery('task', taskGR.sys_id);
    slaGR.query();
    if (slaGR.next()) {
        current.variables.ad_sla = 'true';
        slaGR.stage = 'in_progress';
        slaGR.update();
        slaGR.update(); //updates without a forceupdate. saw on a community post that this was used instead when someone had issues with forceupdate
    }
}

View solution in original post

6 REPLIES 6

Hi,

Thanks, glad it was helpful (and also helped prompt to add the script).

Please mark reply as Helpful, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

jyan3
Kilo Guru

had to edit the task workflow and specifically set the stage to in_progress and update()

var taskGR = new GlideRecord('sc_task');
taskGR.addQuery('request_item', current.sys_id);
taskGR.addQuery('short_description', 'STARTSWITH', 'OFFBOARDING Update AD/change AD password');
taskGR.query();
if (taskGR.next()) {
    var slaGR = new GlideRecord('task_sla');
    slaGR.addQuery('task', taskGR.sys_id);
    slaGR.query();
    if (slaGR.next()) {
        current.variables.ad_sla = 'true';
        slaGR.stage = 'in_progress';
        slaGR.update();
        slaGR.update(); //updates without a forceupdate. saw on a community post that this was used instead when someone had issues with forceupdate
    }
}