GlideDateTime.subtract with a schedule

aaron_anderson
Tera Expert

There is an OOB business rule that calulates the wait time based on actual time (see below). Our requirement isn't to get the actual time but similar to how an SLA would run, base it on a schedule. How would this be modified to take into consideration only time within a specific schedule?

 

var creation = current.sys_created_on.getGlideObject();
var waitTime = GlideDateTime.subtract(creation, new GlideDateTime());
var target = current.queue.target_wait_time.getGlideObject().getNumericValue();
if (target > 0) {
current.exceeded = (target < waitTime.getNumericValue());
}
current.wait_time = waitTime;

1 REPLY 1

sachin_namjoshi
Kilo Patron
Kilo Patron