Set up an SLA for a Task's Due Date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2011 11:54 AM
I would like to create an SLA Definition that sets the Task SLA Planned end time equal to the Due date of the Task its attached to. I have already tried a Task SLA Business Rule that manually overrides the Planned end time value, but it appears the SLA is already calculating by the time I override it -- so altering the Planned end time has no effect. I have also tried to create a custom Relative Duration called "Use due date". It works most of the time, but unpredictably produces Planned end time values that are much sooner than the Task's Due date. Here is the script for the custom Relative Duration:
var d = current.task.due_date.getGlideObject(); var s = (d.getNumericValue() - (new GlideDateTime()).getNumericValue()) / 1000; calculator.calcDuration(s); current.planned_end_time = d;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2015 09:14 AM
Mark Stanger This is the thread that I was referring to in my reply yesterday, where you all were able to get due_date from task working for SLA's.
My followup question to it however, is how do you calculate the business duration? I noticed that my business elapsed percentage is incorrect when using this script, and ServiceNow HI support has informed me it's because my relative duration does not have a specific "Duration" set on the SLA, so the percentage has nothing to work with. Any ideas?
@jamesrgrinter Are you still around?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2015 12:39 PM
Right, this is what I was referring to as well . The calculations end up messed up and there's no fix that I'm aware of...hasn't been for several years. I wish I had a better answer but the only thing I can say is to ask ServiceNow to build it into the tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2015 12:53 PM
Just to clarify because I am bouncing between so many topics and losing track, relative duration for SLA's on tasks and their due_date data is working (as per this thread), but trying to do a relative duration script for a due date calculation on an RITM from a date/time variable is not working correctly?
Thanks.
(Edited as of 12:57AM PST)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2015 09:21 AM
I am sorry to bug you on this Mark Stanger but I was wondering if you could please take a moment to reply to my above questions?
Much thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2015 08:54 PM
Anyone know how to get the Due Date field to be the same as the SLA's original breach time? I just need a straight copy of the field times and don't see the SLAs in the Business Rule options. Thanks!