We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Schedule report on first monday of every month

SKR
Giga Contributor

Hi,

 

I am trying to schedule a report that needs to be sent on first Monday of every month and I have used a below query, Can someone hep me understand whats wrong in the query.

function checkmonday() {
var gdt = new GlideDateTime();
var day = gdt.getDayOfWeek();
var result = false;
if (day == 1 && gdt.getDayOfMonth()<=7){
result = true;
}
return result;
}
checkmonday();

 

and I have schedule as follow:

 

RUN: Weekly

Day: Monday

Time : 8:00 AM

 

 

9 REPLIES 9

Jaspal Singh
Mega Patron

Script seems fine.What is the issue?

SKR
Giga Contributor

User is not getting the reports on first Monday of every month

brianlan25
Kilo Patron

When do they get it? Are they not getting it at all?

SKR
Giga Contributor

they are not getting at all