Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need help on date fuction

JPSS
Tera Contributor

A task needs to be created on 7 th jan ,April,July,oct (Each Quarter).

 

How can i find the next trigger date  compared to today

 

 

1 ACCEPTED SOLUTION

Harish KM
Kilo Patron
Kilo Patron

Hi @JPSS create a schedule job which runs daily and in condition field place this script

var gdt = new GlideDate(); //creates new date object
var m = gdt.getMonth();  //extracts the month
var d = gdt.getDayOfMonth();  //extracts the day
if((m == "4" || m == "7" || m == "10") & (d == "7")){
    answer = true;
}
HarishKM_0-1709879988839.png

 

Regards
Harish

View solution in original post

5 REPLIES 5

Hi,

 

I need to capture the next trigger date in a variable. How can i get that