Calculating the time and incident has been open for

Dubz
Mega Sage

Hi All,

One of our managers wants to be able to produce a list of incidents and have a field there for each one saying how long it has been open for. What's the best way to go about this?

I thought the easiest way to do this would be to add a new field to the incident form and add in the calculated value something like:

var opened = current.opened_at.getDisplayValue();

var now = gs.nowDateTime();

var time = gs.dateDiff(opened, now, true);

My first question is, what performance effect (if any) will this have if it is calculating this value for every incident? If it's going to have a knock on performance issue would i be better off making this a metric instead?

If it isn't going to effect performance, how do i present the resulting seconds in a days/hours/minutes/seconds time field?

1 ACCEPTED SOLUTION

Uncle Rob
Kilo Patron

Hey David,



The problem with Calculated fields is that they don't perpetually calculate in real time.   The only calculate on a create or update.   Thus you'll never get the "time open" but rather "the amount of time this was open the last time I saved it".



This use case is really best supported by Performance Analytics, where your management would simply look at the oldest tickets (and the pattern of age) and drill in from there.  


View solution in original post

21 REPLIES 21

YOu Need to Modify this metric Some what.



You can do reporting as well. You can create a custom field and by running a script on some schedule put the time calculated from Opened at to gs.nowDateTime();



And in Report you can use this field.



Thank you,
Ashutosh


Uh, no.


The "Open" metric will only populate a duration after the whole ticket has gone inactive, which could possibly be *days* after resolution.   Up until that point, the metric will contain null data.


Yes,



i am saying that we can configure similar metric with some additional condition which he wants.



Thank you,
Ashutosh


Uncle Rob
Kilo Patron

Hey David,



The problem with Calculated fields is that they don't perpetually calculate in real time.   The only calculate on a create or update.   Thus you'll never get the "time open" but rather "the amount of time this was open the last time I saved it".



This use case is really best supported by Performance Analytics, where your management would simply look at the oldest tickets (and the pattern of age) and drill in from there.  


Hi Robert,



Thanks for the info, i thought calculated fields would be an easy fix but it sounds like they'll actually be quite confusing if they are saying one thing when the ticket loads and then suddenly jump up a few hours/days/weeks/eons when you save it.



i believe we are looking into acquiring PA licenses so i'll look into tit further then, maybe i'll make a metric for the interim.