Write Script to Calculate Time to Resolve/Closed - MTTR (Task Table)

Eddie5
Tera Contributor

Hi All,

I am trying to create a report on task table (Inc & SC Task only) for MTTR. We need to calculate time duration from opened to resolved for Incident and Opened to Closed for Sc_Tasks.
Can we write a script on task table to compare these two values and get summed duration on indicators for MTTR metric?

I am aware we have OOO reports on incident table and we have customized it for sc_task table however this time we want this on task table (task) so need help how to script this?

Below is script used OOO

var diff=function(x,y){return y.dateNumericValue() - x.dateNumericValue();};
var hours=function(x,y){return diff(x,y)/(60*60*1000);};
hours(current.opened_at, current.closed_at);

We have reached till here and unable to modify script to get comapre values to get duration. 

 

find_real_file.png

11 REPLIES 11

schedules are defined in SLA's under schedules, you can create different schedules as per vendor and then attached each one on ticket as per assignment group

Community Alums
Not applicable

Hi Mark Manders,

To consider the Vendor schedules how to modify the script below or are there any OOTB metrics I can make use of? I am trying to build it as a Performance Analytics report with a breakdown as 'vendor'.Can you please share with me the facts table to use, I used the incident table and aggregate it as 'Average' and the field as 'Business duration' am I doing it right? Kindly help me on this request, thanks in advance.

var diff=function(x,y){return y.dateNumericValue() - x.dateNumericValue();};
var hours=function(x,y){return diff(x,y)/(60*60*1000);};
hours(current.opened_at, current.closed_at);