How to show actual duration for incidents that are still open?

e_wilber
Tera Guru

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?

7 REPLIES 7

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.

bharris
Tera Contributor

I tried this and added the name of my custom field, but the number is still counting up after resolving the INC.

daviddalley66
Giga Contributor

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.