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.

Store month and date value in system property

jalipatisir
Tera Contributor

I would like to store national holidays month and date value in system property so, that I can compare termination last working date field from HR profile. 

Can you suggest that how can we store date and month value in system property?

Thanks,
Sireesha.

2 REPLIES 2

Di Zhang
Tera Guru

why do you use a work schedule to implement this function instead of using system properties? 

J Siva
Kilo Patron
Kilo Patron

Hi @jalipatisir 
You can achieve this using a schedule entry along with a server-side or client-side script. Create a new schedule that includes public holidays, and then use the script below to check whether a specific date falls within that schedule.

var scheduleId = 'SYS ID OF YOUR SCHEDULE';
var scheduleRecord = new GlideSchedule(scheduleId);
var date = new GlideDateTime();
if (scheduleRecord.isInSchedule(date)) {
    gs.info("Holiday");
} else {
    gs.info("Working day");
}

Note: Change the script logic  as required.
Regards,
Siva