How to show actual duration for incidents that are still open?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2023 12:22 PM
In list view we'd like to have an actual duration from when the record was open until it was displayed in list view. I thought a custom calculated duration field would do the trick but I guess calculations only happen on insert/update of the record rather than on display in list view.
What options do we have to have an accurate duration field when looking at our open records in list view?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 12:28 PM - edited ‎10-18-2023 01:40 PM
create a business rule, Runs 'Before', with Condition "State", "Changes to", "Closed" that updates a new custom field, using script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.u_customDurationField = datediff(sys_updated_on, sys_created_on);
}
Then use that new field for reporting, or whatever.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2025 12:30 PM - edited ‎07-28-2025 12:51 PM
I tried this and added the name of my custom field, but the number is still counting up after resolving the INC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2025 05:13 AM
You can calculate the actual duration for open incidents by using a Glide Date Time script that measures the difference between the current time and the incident's opened at field.