State duration from Assigned to On Hold

Sergio Gonzalez
Tera Contributor

Hi Everyone, 

I'm using a Performance Analytics Script to get the incident state duration from Assigned and In progress tickets, but those tickets have to go through On Hold State after that.

Here is my script:

var diff=function(a, b){
    if((current.inc_incident_state==5 || current.inc_incident_state==2) && current.inc_incident_state==3 ){
        return b.dateNumericValue() - a.dateNumericValue();}
    else{
        return 0;}
};
var days=function(x,y,z){return diff(x,y,z)/(24*60*60*1000);};
days(current.mi_start, current.mi_end);
 
This is giving me 0 cause tickets don't have more than 2 values for incident_state. But How can I check if a ticket is On Hold after being in Progress and Assigned? 
 
Thank you 

 

0 REPLIES 0