Ratnakar7
Mega Sage

Hi @Wasdom_Kung ,

 

You are comparing the duration value as a string. To properly compare the duration, you can convert it to a numeric value.

Here's an updated version of the comparison:

var timeOpen = new GlideDuration(timeOpenMS);
var timeOpenValue = timeOpen.getNumericValue();

// Compare timeOpenValue to the threshold
if (timeOpenValue > 120 && data.table == 'incident' && gr.active == true &&
    (gr.priority == 1 || gr.priority == 2 || gr.priority == 3 || gr.priority == 4) &&
    (gr.incident_state == 1 || gr.incident_state == 2) && gr.escalation == 0 &&
    gr.company == 'ad0459981b7c0c100375ca217e4bcbb0' &&
    (gr.caller_id == gs.getUserID() || gs.hasRole("admin"))) {
    data.showWidget = true;
    data.showEscalate = true;
    vEscalate = 0;
}

 

 

Thanks,

Ratnakar