Any advice on using duration field for closed problem tasks

JohnEJasinski
Tera Expert

Help - trying to use the Duration field on Closed Problem Tasks.   

Created to Closed, but nothing is showing in the Duration field.   

What am I missing?  

2 REPLIES 2

Robert H
Mega Sage

Hello @JohnEJasinski ,

 

Using the Duration and especially the Business Duration fields is no longer recommended, as SLAs provide a better alternative that gives more control over the schedules and time zones involved in the calculation.

 

If you want to go ahead with using the duration fields you can create a Business Rule as shown below:

 

RobertH_0-1745650173277.png

 

Advanced Script:

(function executeRule(current, previous /*null when async*/ ) {

    current.business_duration = gs.calDateDiff(current.opened_at.getDisplayValue(), current.closed_at.getDisplayValue(), false);
	
    current.calendar_duration = gs.dateDiff(current.opened_at.getDisplayValue(), current.closed_at.getDisplayValue(), false);

})(current, previous);

 

Regards,

Robert