- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2020 01:49 AM
Hi,
I have a requirement where i need to send a notification as a reminder on last week of every quarter.
Example:
March 23 of 2020 for Q1
June 22 of 2020 for Q2 and so on.
Can anyone please help me out how to acheive this ?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2020 02:17 AM
Hi Irfan,
You can create a schedule job that Runs as below with script.
executeonLastWeek();
function executeonLastWeek() {
//gives you current date time
var getdtime = new GlideDateTime();
//gives you current month number 1-Jan, 2-Feb, so-on
var getmonth = getdtime.getMonth();
//execute only if it is start of quarter
if (getmonth == '3' || getmonth == '6' || getmonth == '9' || getmonth == '12') {
//gets you number of days in month 30 or 31 or 29
var days_in_month = getdtime.getDaysInMonthUTC();
//gets you today's date
var day_of_month = getdtime.getDayOfMonthUTC();
if (day_of_month >= days_in_month - 6) {
//return true;
//your script here to set reminder gs.eventQueue();
} else {
// return false;
//do nothing
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2020 03:32 AM
Hi,
This is just and example and is used for one record. If we use it wisely and with lookup records then only one flow will do your job and will not degrade the performance for sure.
This runs in background is not that complex.
Everything has its own advantage and downside, its upto us how to use it and not.
Infact i have one subflow created in my environment to send reminder notifications for any table in servicenow. Assume how much time this saves. Only matter of passing values to that subflow and you are done.
But yes if its to complicated then we have to make sure it doesnot impact or haunt us later.
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2020 07:42 AM
Thanks for the idea, i definitely wanted to try with the flow designer let me follow your approach and will update you accordingly

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2020 06:41 PM
He's already attached screenshot of the proposed Flow Design.
The flow is checking if it's the beginning of the quarter within the Action section. You'll still need to write Javascript code within the custom Action step.
So, it's not a matter of amount of Javascript code that needs to be written because both methods will require the same amount of code but where the code is written.
If the Flow Designer has a trigger for Quarterly event, I'll definitely recommend using the Flow Designer. As it is, there's more steps that has to be to done. This implies there's more things that needs to be maintained to use Flow Designer compared to using Scheduled Jobs.