schedule a report per quarter

solymyr
Kilo Expert

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?

1 ACCEPTED SOLUTION

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


View solution in original post

5 REPLIES 5

Matthew Fody
ServiceNow Employee
ServiceNow Employee
switch (new GlideDateTime().getMonthLocalTime()) {
  case 1:   //for Q1
  case 4:   //for Q2
  case 7:   //for Q3
  case 10:  //for Q4
    answer = true;
    break;
  default:
    answer = false;
}
gs.print(answer)