- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2017 04:00 AM
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?
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2017 06:17 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2017 04:02 AM
Hi David,
Metric Gives you the time incident was opened for.
You can refer to that.
Thank you,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2017 05:25 AM
Hi Ashutosh,
Which metric gives that info? I can see create to resolve time but i need to show duration between opened_at and the time now.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2017 05:34 AM
Hi David,
Can you Check In Metric definition.
Name: Open
Table Incident.
Once you open this then in related list you can see incident. This gives you the example.
Similarly We can configure your requirement.
Thank you,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2017 06:14 AM
Hi Ashutosh,
The Open metric has the below description:
'Special case that closes out (ends) other metrics when an the active flag in the incident turns false'
It doesn't look like it's actually measuring the time between the opened_at and now...?
Am i better off configuring a metric for reporting or configuring a calculated field?