How to get due date of next 15 days exclude holidays and weekends

azeez
Kilo Contributor

Hello Everyone,

I want a calculate the Due date of next 15 days which must exclude the holidays and weekends.

I've been reviewing the Calculating Due Date Based on Requested Date   to figure out how to display''Due Date' in date/time variable . I think I need to create a schedule of 8-5 weekdays excluding holidays but i don't know how to design to achieve this, does anyone have any advice?

andrew.venablesjim.coynekalai

Thanks in Advance,

Abdul Azeez

1 ACCEPTED SOLUTION

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Hi,



Take a look at this blog post I made.. here I use relative durations (which you can create one for 15 days) And put that into a durationcalculator and a schedule to calculate the correct time.



IF you look at the script, you can use the dc.getEndDateTime() to get the end time. Let me know if you need more help with it. Not sure where you want for it, but Im guessing a catalog client script? and then you need to put this in a script include and call it from the client script.



How to close ticket after 3 business days



//Göran


View solution in original post

7 REPLIES 7

harmangill02
Mega Expert

Abdul,



If i understand correctly, this sounds like the perfect opportunity to use the Service Level Agreements (SLAs). You can setup an SLA on a task and run it against a schedule (8-5 weekdays excluding holidays) and have a business rule that populates the due date according to the SLAs breach date.



Plus, you can easily report on the tasks that are breached (meaning past due) or on time. For more information on how to set them up, follow the link below. Let me know if you have any questions! Thank you.



http://wiki.servicenow.com/index.php?title=Service_Level_Agreements#gsc.tab=0


Harman,



thanks for the reply. This is not something related to SLA's.



This requirement is to work on catalog variables in which Date/Time variable must work as per schedule excluding weekends and holidays.



We need to write some script and use 8-5 weekdays excluding holidays schedule.




Please help me out on this if you can.


Aaron Schmid
Tera Contributor

You'll need to create an 8-5 weekdays excluding holidays schedule. To do this just go to System Scheduler > Schedules, create new, and choose Repeats: Every Weekday (Mon-Fri) on the schedule entry. Then you'll need to create schedule entries for holidays. Here is a link to help you...



Using Schedules - ServiceNow Wiki



I hope this helps you!


Aaron,



thanks for the reply.



As this should be run on Service Catalog Date/Time variable i dont think Scheduler will come in the picture.



I think there should be some script to write on Script include & Catalog client script.