The CreatorCon Call for Content is officially open! Get started here.

Run Scheduled job script on every month on 31st and for february it should run on 28th or 29th

Pratiksha Lang1
Kilo Sage

How to Run Scheduled job script on every month on 31st and for February it should run on 28th or 29th. What script can I write in scheduled job condition

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Pratiksha Lang1 

just set the scheduled job to run on 31st or 30th

if the month has 30 days then it will run on 30th day

If the month has 28/29 days i.e. February then it will automatically run on last day

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankit7Choudhary
Tera Expert


Hi @Pratiksha Lang1 ,


Yes you can do it by selecting the scheduled to run on the 31st of the month. For more info you can refer below :-

End of the month schedules

Because months have different lengths, take care when scheduling jobs for the end of the month.

  • Scheduling an event for the 29th or 30th is not recommended, because the scheduled job is executed in months (like February) which are shorter than those dates.
  • If an event is scheduled for the 31st, it executes on the last day of the month, even if the month is shorter.

For example, something scheduled to run on the 31st of the month runs on February 28 or February 29 in a leap year.

 

https://docs.servicenow.com/en-US/bundle/utah-platform-administration/page/administer/time/reference...

 

If my response helps you to resolve the issue close the question by Accepting solution and hit 👍thumb icon. From Correct answers others will get benefited in future.

 

Thanks,
Ankit