Schedules - How can we know which schedule is currenlty running or active according to its own tz?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 02:23 AM
Hi All,
How can identify an a schedule entry is active?
Lets take a example:
I created a schedule, inside that I created a schedule entry like below Screenshots.
Schedule:
schedule entry:
In my case schedule is from 8AM to 7pm PST MON to FRI , but consider I am in different time zone. How can I know if the schedule entry is currently running or say active?
To simply put: I want to check if a schedule is currently running according to the schedule’s own time zone (e.g., PST), regardless of the system/server time zone?
#dev #HRSD#ITSM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 02:32 AM
@siva91 You can use the "Show schedule" related link in the schedules. Depending on the logged in user it gives us the exact time when the schedule is active.
Please mark the answer helpful and correct if it helps the issue. Happy scripting 🙂
-Shantanu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 02:37 AM
@shantanu_patel8thanks, but what if I need to use in scripting? To be precise I have a widget in esc portal that will show a message. But I need to show the widget only when this schedule entry is active, if its not active I should hide it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 02:47 AM
You can use isInSchedule(date) method to check if the "date" passed as parameter is in schedule or not.
Please refer https://www.servicenow.com/docs/bundle/vancouver-api-reference/page/app-store/dev_portal/API_referen...
The above url should give you the detail on how you can use it in a script.
Please mark the answer helpful and correct if it helps the issue. Happy scripting 🙂
-Shantanu