Due Date SLA.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 04:42 AM
Hi Team,
I need to set the Sla duration time based upon the due date field which is present on the Request item form.
Indetail:
I have field on the Request item form. So based upon this date the duration of sla need to set.
Due date (req item form) should match the duration of Sla.
Thanks,
Ajay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 05:43 AM
Looks like it should be. Why you say "I have field on the Request item form" do you mean you have a field in the sc_req_item table? Or do you have a variable on a Catalog Item?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 05:49 AM
It is a variable and I am populating this on the field of Req item which is on table( sc_req_item). Populating it via the workflow current.due_date=current.variables.due_date; it is working fine.
But my problem here is Run Sla on the sc_req_item table ... based upon the duration of the due date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 05:46 AM
AAAAAAAAAAAACTUALLY... no... this doesn't work the way I thought it did. All this field does is allow you to alter the Time Zone and Schedule sources. That doesn't help us start with the Due Date at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 05:51 AM
So the difficulty here is that SLA's are meant to be promises made based on objective criteria, and the criteria is defined in the SLA record itself. Once a positive is found, the SLA applies its designated timeline to the defined schedule and time zone to arrive at a Due Date. The engine isn't built to work backward from a previously established date. (in fact, that would be counter to contractual Service Level Agreement).
The way we usually operate in the catalog is treating the Catalog Item as a service that we build an SLA for. So the table would be Requested Item and start condition would be Catalog Item = <whatever item you're building promises for>.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 12:05 PM
Hello,
I think this may be helpful. Reference - Developer instance(jakarta).
Need to create a Relative Duration "Breach on Due Date" if it is not there in the system with below script.
---------------------------------------------------------------------------------------------------------------------------------------------------------
/* This relative duration script will set the Breach Time of the Task SLA to the value in the "Due date" of the Task.
If the "Due date" field is available on the Task form and editable then this effectively allows the user to specify the
Breach Time of the SLA.
If the Due Date field is empty or in the past, the script will instead set the Breach Time of the SLA to 1 second
after the Start time
*/
(function() {
var startDateMs = calculator.startDateTime.getNumericValue();
var dueDate;
// Work out if "current" is a Task record or Task SLA and then get the "due_date" element from the Task
var tableName = current.getTableName();
if (tableName) {
var baseTableName = GlideDBObjectManager.getAbsoluteBase(tableName);
if (baseTableName == "task")
dueDate = current.getElement("due_date");
else if (baseTableName == "task_sla")
dueDate = current.getElement("task.due_date");
}
// if we've got a "due_date" and it's after our SLA's Start time then use it
// otherwise we'll have to default to the same as Start Time plus 1 second (i.e. instant breach of SLA)
if (dueDate && !dueDate.nil() && dueDate.dateNumericValue() > startDateMs)
dueDate = dueDate.getGlideObject();
else {
dueDate = new GlideDateTime(calculator.startDateTime);
dueDate.addSeconds(1);
}
// if we have a schedule then check if the Due Date is in it and if it isn't
// find the next time we are in the schedule
if (calculator.schedule && !calculator.schedule.isInSchedule(dueDate))
dueDate.add(calculator.schedule.whenNext(dueDate, calculator.timezone));
// set the endDateTime property of the calculator object to dueDate
calculator.endDateTime = dueDate;
calculator.calcScheduleDuration();
})();
---------------------------------------------------------------------------------------------------------------------------------------------------------