- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2017 09:43 AM
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?
Thanks in Advance,
Abdul Azeez
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2017 02:05 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2017 02:05 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2017 09:00 PM
Hi Abdul,
GlideSchedule API is what you need to try with to calculate 15th day excluding holidays and weekends.
https://developer.servicenow.com/app.do#!/api_doc?v=helsinki&id=c_GlideScheduleScopedAPI
isInSchedule method of the API you should try with, I would set the counter of 15 and count of X. I would increase X by 1 and will check if day is in schedule. When x value reaches 15, that would be my 15th day as per schedule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 09:04 AM
Hi Deepak,
Can you provide me the script bro?
Thanks,