- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2015 06:12 AM
This one might be easy and I'm just missing it but I'm looking to create a report for incidents that shows a report that shows the time elapsed from when a ticket was created to when it was first addressed/updated. I know the numbers may be a bit misleading as we aren't a 24/7 shop and the times would be ticking during off hours so if anyone would know a magic trick to keep that out I'd be most grateful.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2015 04:55 AM
Hopefully this helps you out, I got the same message that you did when I clicked the original links.
I created a new metric definition. On the incident table and the incident state field and the type was script calculation with the following script;
// variables available
// current: GlideRecord - target incident
// definition: GlideRecord - (this row)
if (current.sys_mod_count == 1)
createMetric();
function createMetric() {
var mi = new MetricInstance(definition, current);
if (mi.metricExists())
return;
var gr = mi.getNewRecord();
gr.start = current.sys_created_on;
gr.end = current.sys_updated_on;
gr.duration = gs.dateDiff(gr.start, gr.end);
gr.calculation_complete = true;
gr.insert();
}
I'm looking for the report I was running that pulled the the average time to address but just can't find it. I really dislike the layout for the reports in Fuji but that's another gripe for another time. Let me know if this is what you needed and I'll keep looking for that report if you'd like to see it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2015 04:55 AM
Hopefully this helps you out, I got the same message that you did when I clicked the original links.
I created a new metric definition. On the incident table and the incident state field and the type was script calculation with the following script;
// variables available
// current: GlideRecord - target incident
// definition: GlideRecord - (this row)
if (current.sys_mod_count == 1)
createMetric();
function createMetric() {
var mi = new MetricInstance(definition, current);
if (mi.metricExists())
return;
var gr = mi.getNewRecord();
gr.start = current.sys_created_on;
gr.end = current.sys_updated_on;
gr.duration = gs.dateDiff(gr.start, gr.end);
gr.calculation_complete = true;
gr.insert();
}
I'm looking for the report I was running that pulled the the average time to address but just can't find it. I really dislike the layout for the reports in Fuji but that's another gripe for another time. Let me know if this is what you needed and I'll keep looking for that report if you'd like to see it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2015 06:16 AM
Thanks, this is my 'side -project' so I wont get back to it for a while.
Will message you when I have tested it
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2015 06:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 03:42 AM
Hi,
This script is not returning correct values.
Please let me know if this script is capable of capturing values in seconds