GlideDateTime.subtract with a schedule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2020 12:12 PM
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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2020 12:14 PM
below article should help
Regards,
Sachin