- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2016 02:24 AM
Hello,
I am currently trying to schedule a report.
It is something that I have done quite a few times.
But today I am struggling to schedule the report at the beginning of every quarter.
The report should run at the beginning of every quarter.
Any suggestions on how to realize this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2016 03:24 AM
Hi solymyr
YEs it is possible to run a report whenever you want it,
Open Scheduled Reports
Then select 'Monthly' under 'Run" field
Day :1
Conditional : true
Paste the script below under condition tab ;
var gdt = new GlideDateTime(); // for example this month is january,
gs.print(gdt.getMonth()); // output will be : *** Script: 1
if (gdt.getMonth() == 1 || gdt.getMonth() == 5 || gdt.getMonth() == 9 ) {
answer = true;
}
You want your scheduled report to operate every quarter, meaning on 1st january, 1st May, 1st September
Let me know if you need futher info.
Kind regards,
Do not feel shy to mark correct or helpful answer if it helps or is correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2016 02:42 AM
I think you schedule the report to run Monthly on Day 1 and then add a Condition to say "only if MONTH = JAN or APR or JUL or OCT" (for example)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2016 03:24 AM
Hi solymyr
YEs it is possible to run a report whenever you want it,
Open Scheduled Reports
Then select 'Monthly' under 'Run" field
Day :1
Conditional : true
Paste the script below under condition tab ;
var gdt = new GlideDateTime(); // for example this month is january,
gs.print(gdt.getMonth()); // output will be : *** Script: 1
if (gdt.getMonth() == 1 || gdt.getMonth() == 5 || gdt.getMonth() == 9 ) {
answer = true;
}
You want your scheduled report to operate every quarter, meaning on 1st january, 1st May, 1st September
Let me know if you need futher info.
Kind regards,
Do not feel shy to mark correct or helpful answer if it helps or is correct

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2016 07:48 AM
Thanks for this,
Changed the script to use days by changing the method to getDayOfWeekUTC.
var gdt = new GlideDateTime();
gs.print(gdt.getDayOfWeekUTC()) // output for Monday will be: *** Script: 1
if (gdt.getDayOfWeekUTC() == 1 || gdt.getDayOfWeekUTC() == 2) {
answer = true;
}
Tested for today and appears to work, should work for second condition tomorrow too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2016 03:30 AM
I've made two typos,
The first one I edited in my previous post (it is : if (gdt.getMonth() == 1 || gdt.getMonth() == 5 || gdt.getMonth() == 9)) without the '||' after 9)
for the second one, if it does not work, try the condition like following :
if (gdt.getMonth() == '1' || gdt.getMonth() == '5' || gdt.getMonth() == '9') {
...
}
Really sorry for the typos
Kind regards,