SLA requirement

pramn
Tera Guru

Morning team , 

we have a requirement to create SLA  Durations,

When case is created today  before 2PM  , sla should  get attached and after 2 PM  then SLA get attached next day 

can someone please help me out how do i achieve this ?

1. Same Business Day if created < 2pm
2. Next Business Day if Created > 2 pm

 

I tried with some scripts looks lie its nor working 

if (calculator.isAfter(calculator.startDateTime, "14:00:00")) {
days++;
}

calculator.calcRelativeDueDate(calculator.startDateTime, days, "16:00:00");

 

Need your help to fix this .

Thanks in advance ...

4 REPLIES 4

Ahmmed Ali
Mega Sage

Hello @pramn 

 

Where are you trying to write the script? 

 

You can create a schedule for your business time and attach that schedule to you SLA, so that the SLA will be active for that duration only. 

Example: if you see OOTB 8*5 weekdays schedule attached to SLA, then if any case created on weekend or outside 8 AM to 5 PM will be attached will SLA but the SLA will not consider that timing. It will start considering time only during week days in the specified time period.

 

Refer: https://docs.servicenow.com/bundle/utah-it-service-management/page/product/service-level-management/... 

 

https://www.youtube.com/watch?v=_KvlEzqd3KU 

 

Let me know if I misunderstood.

 

Thank you,

Ali

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Thanks Ali, 

but thr client has given 2  conditions , one is for duration and other is one for Schedule 

pramn_0-1689920570029.png

This what making me confused.

 

Did you figure this out? I have a similar need.

RikV
Tera Expert

The easiest way to do this would probably be be to just create 2 sla definitions that would start upon record creation.

 

1 for same business day complete

1 for next business day complete

 

Then, add a cancel condition to both of the definition based on if the record was created was before 2pm or after 2pm, so that only the relevant one keeps running and the other one gets cancelled out. The relevant will then just continue and completes according to complete conditions. Separating the 2 also offers more benefits in regards to reporting on different sla conditions etc.