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

Thanks Jason, i had dismissed SLA's as they get paused in various states but i forgot they have actual elapsed time as well!


They don't have to pause. It'll depend on what conditions are contained in the SLAs. Active = True for the Start condition, the Stop condition can be Active = False or I've seen people use State IS ONE OF Closed, Resolved or Canceled.



As Robert noted, you'll probably want to name these SLAs with something easy to filter-out. Another consideration is impact on instance performance. I'm certainly not an expert on this aspect, but, I'd imagine there will be some impact due to additional Task SLAs running.



There is no one panacea for this, but, I'd thought it would be a good idea to point this out.