Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

SLA Actual elapsed percentage

billy7
Tera Expert

I read a lot of articles and I don't still understand how actual elapsed percentage is calculated. when I see for example the actual elapsed percentage of the one I attached in this post, I don't get it. I found the script include (SLACalculatorNG) that does the math to try to understand which is the following:

currentSLA.percentage = ((currentSLA.elapsed / (currentSLA.derived_end_time - currentSLA.start_time - currentSLA.pause_duration)) * 100).toFixed('2');
 
I have no idea where the attribute .derived_end_time is taken from or how it is calculated (there is no field in the task_sla record with that name). Does anybody knows something to guide me here?
Thank you in advance
1 REPLY 1

ZacharyKenyon
Kilo Guru

In that script include, the currentSLA object is not a GlideRecord - it's just a Javascript object populated with values.  It's created in the _createTaskSLA(sla) function in that script include.  The derived_end_time property is calculated based on the sla_duration and business_pause_duration from the task_sla record.  In my instance it's on line 314-315 of that SLACalculatorNG script include:

 

var dc = this._newDurationCalculator(sla, newTaskSLA.sla_duration + newTaskSLA.business_pause_duration, slaDefGR);
newTaskSLA.derived_end_time = dc.getEndDateTime().getNumericValue();