Write Script to Calculate Time to Resolve/Closed - MTTR (Task Table)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 05:59 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2022 11:48 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 07:51 AM
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);