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.

Sending update letterhead

Matheus Rissi2
Tera Expert

Hello community.,

Could you clarify a doubt about how I could carry out the following process?
Validate if a case has not been commented by the solver within 5 working days to send him a e-amil reminding him that he must document it, for any state except resolved or closed.

I would like to have an idea of how to do it or where to start

6 REPLIES 6

Hi Time, 

Thanks for the answer, but the problem is that I must disregard weekends for the calculation and I must also only check for comment updates.



Hi @Matheus Rissi2 

Yes we can leverage the GlideSchedule API to load a schedule that excludes the weekend for your calculation.

Sample below.

var schedule = new GlideSchedule();
schedule.load('ded21b2047d27910ab9bb6bf016d43a0'); //24x5 Schedule
var duration = schedule.duration(gdtStart, gdtEnd);
var days = duration.getDayPart();

 

To provide a more accurate sample script for your specific use case, could you please provide additional details on the following queries:
1. "A case has not been commented by the solver within 5 working days"  => What date are the 5 working days compared to? (ex: latest comment, latest update, etc)

2. Which Case table you're mentioning about?

 

Cheers,

Tai Vu