- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2015 02:19 AM
Hi,
I need to create Schedule job to generate notifications based on expiration of certificates. notification should be sent 60 or 30 days prior to the expiration.
Have created the following:
var cert = new GlideRecord('u_certificate');
cert.addQuery('u_expiration_date','<=',gs.daysAgo(-60));
cert.addQuery('u_expiration_date','<=',gs.daysAgo(-30));
cert.query();
while(cert.next()) {
if (u_expiration_date <= cert.u_expiration_date) {
gs.eventQueue("cert.expire.reminder", cert);
}
}
I need to send this notification to a group, which I am doing it via Email notification using the Event.
Please suggest.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2015 02:38 AM
Hi All,
I have got this fixed as below :
wmcFirstJob();
wmcSecondJob();
function wmcFirstJob()
{
var gr = new GlideRecord('u_certificate');
gr.addEncodedQuery('u_expiration_dateRELATIVEEE@dayofweek@ahead@30');
gr.query();
while(gr.next()){
gs.eventQueue("cert.expire.reminder",gr,30);
}
}
function wmcSecondJob()
{
var gr = new GlideRecord('u_certificate');
gr.addEncodedQuery('u_expiration_dateRELATIVEEE@dayofweek@ahead@60');
gr.query();
while (gr.next()){
gs.eventQueue("cert.expire.reminder",gr,60);
}
Thanks Pradeep and Kalai!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2018 07:49 AM
Hi Team,
I am facing same issue to generate multiple notifications.
have you created new event called cert.expire.reminder for u_certificate table.
Do we need to write business rules or scripts for this table?
I want to send notifications for below 4 conditions..
Trigger Criteria | Days | Mode | |
First Email | 60 Days | Alert | |
Second Email | 45 Days | Warning | |
Third Email | 30 Days | Critical | |
There after | Ever day from 15days or less | Business Critical |
Please help me to solve this.Developer Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2020 05:44 AM
Hi There,
I have Created Article to send Notification using Schedule Job, please take a moment to review and update feedback.
Notify using Scheduled JOBS in ServiceNow
https://community.servicenow.com/community?id=community_article&sys_id=1dd55f001b255010ada243f6fe4bcba8
If the article helps you, please mark it as Helpful, Bookmark it, subscribe it and your feedback would be much appreciated.
Thank You!
Regards,
Kailash