Iamshankha/Adaptive Scheduler – Automated Report Scheduling with Business Day Awareness#1951
Closed
iamshankha wants to merge 2 commits intoServiceNowDevProgram:mainfrom
Closed
Conversation
Adaptive Scheduler Purpose: Automates quarterly report scheduling by intelligently adjusting the run date based on weekends or Fridays. Business Logic: The report is configured to run monthly on the 5th day. The script checks if the 2nd day of the quarterly month (February, May, August, November) falls on a Friday or weekend. If the 2nd day falls on a Friday or weekend, the scheduled report will run on the 5th day instead. If the 2nd day is a regular business day, the report will already be sent on the 2nd day of that month. 💡 Benefit: ⏰ Minimizes manual intervention and ensures reports always run on valid business days — maintaining consistent quarterly reporting. Type: Server-side Script (Scheduled Report Condition) Run: Monthly Day: 5
🗓️ Adaptive Scheduler 📘 Overview The Smart Quarterly Scheduler automates report execution for quarterly business reviews. It ensures that scheduled reports never fall on weekends or Fridays, maintaining consistent and reliable delivery. 🧩 Problem Statement The business requires a quarterly report to run on the 2nd day of specific months (February, May, August, and November). However, when the 2nd day falls on a Friday or weekend, the client team will be typically on leave and may miss reviewing urgent reports. This results in communication delays and missed insights during critical business periods. 💡 Solution This script dynamically checks whether the 2nd day of the quarterly month is a Friday or weekend: If yes → the report automatically runs on the 5th day. If no → the report runs as usual on the 2nd day through another Scheduled Report. It uses GlideDateTime logic to determine execution dynamically within the Scheduled Report Condition. 🚀 Benefits ⏰ Minimizes manual scheduling effort ✅ Ensures reports always run on valid business days 📊 Maintains consistent quarterly performance insights 🔁 Completely automated logic without admin dependency
ravichandra1998g
requested changes
Oct 8, 2025
Contributor
ravichandra1998g
left a comment
There was a problem hiding this comment.
Please add a descriptive Title and PR Description for the Pull Request
Contributor
Author
Thank you for your inputs. I have made the required changes. Requesting you to review the same. |
ravichandra1998g
approved these changes
Oct 8, 2025
Contributor
ravichandra1998g
left a comment
There was a problem hiding this comment.
Hello @iamshankha
Thank you for submitting!
I will mark this PR as a Hactoberfest accepted and approve it so that it counts towards your Hactoberfest contribution.
But we cannot merge this aa we have a similar code snippets under GlideDateTime folder under Core ServiceNow APIs and we also have similar code existing under Schedule Job Folder already.
- For Hactoberfest, we are aiming for high quality contributions which will be beneficial for the open source community. Please make unique contributions for your upcoming PRs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description:
🗓️ Adaptive Scheduler – Automated Report Scheduling with Business Day Awareness
📘 Overview
The Smart Quarterly Scheduler automates report execution for quarterly business reviews. It ensures that scheduled reports never fall on weekends or Fridays, maintaining consistent and reliable delivery.
🧩 Problem Statement
The business requires a quarterly report to run on the 2nd day of specific months (February, May, August, and November). However, when the 2nd day falls on a Friday or weekend, the client team will be typically on leave and may miss reviewing urgent reports.
This results in communication delays and missed insights during critical business periods.
💡 Solution
This script dynamically checks whether the 2nd day of the quarterly month is a Friday or weekend:
If yes → the report automatically runs on the 5th day.
If no → the report runs as usual on the 2nd day through another Scheduled Report.
It uses GlideDateTime logic to determine execution dynamically within the Scheduled Report Condition.
🚀 Benefits
⏰ Minimizes manual scheduling effort
✅ Ensures reports always run on valid business days
📊 Maintains consistent quarterly performance insights
🔁 Completely automated logic without admin dependency
Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Core ServiceNow APIs/Server-Side Components/Client-Side Components/Modern Development/Integration/Specialized Areas/Documentation
Restrictions