Custom sla relative duration to start from next day

Sharique Azim
Kilo Sage

Hi All,

I am trying to achieve a case where the SLA should start from the next business date  (say 23rd May,tomorrow) and should allow a time of atleast 2 business days from tomorrow (i.e 25th May 00 hrs /24th May 11.59 pm). Such that if the planned date is mentioned as today, SLA should allow me today(whatever the time is),starts counting from tomorrow(if a business day) and take 2 business days from tomorrow to breach.

 

For this steps taken till now:

1.Custom schedule to include  u.s holidays- schedule entry is 2018-05-22: 23:59:59 to 2018-05-23 :23:59:58

2.Set start to planned date of task inherited table.Relative duration works on : Task Record, and Duration type:below created custom relative duration

3.Created custom relative duration script:

// 2 business days by 12am if before 00am
var days = 2;
// If the current time is after 00:00, add another day
if (calculator.isAfter(calculator.startDateTime, "00:00:00")) {
   days++;
}

calculator.calcRelativeDueDate(calculator.startDateTime, days, "23:59:59");   

But i am not sure with the script and the results.

 

I cannot wait till 24th to test.

 

thanks for your suggestions in advance.

3 REPLIES 3

Ct111
Giga Sage

Hi Shariq,

 

You do not need to wait till 24th can you write your script in Scheduled Job and include your schedule and check how your SLA works.

 

You just need to click on EXECUTE NOW button on scheduled job to test it.

 

Hope, this gives you some idea.

 

 

PLease mark my answer as Correct if it served your purpose.

 

 

Thank you , but its not still clear.

 

Can you please provide me the exact mean to include the schedule within the scheduled job?

Sharique Azim
Kilo Sage

Hi All,

 

Any updates here.

 

This SLA is working very weird and is also counting the weekend days too.

For eg, if  work ends on friday it is breaching on monday 11.59 pm...

if work ends on saturday it breaches on tuesday 11.59 pm..

and strangely if work ends on wednesday 4th of july(a us holiday ) breaches on saturday 11.59 pm..