Scheduled Job Script that will notify user 7 days before the expiry date of knowledge article. Notification should be send to user who created that article and his Manager.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2016 02:40 AM
Scheduled Job Script that will notify user 7 days before the expiry date of knowledge article. Notification should be send to user who created that article and his Manager.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2016 03:08 AM
1.Create a event in event registry Ex : renew.kb
2.Trigger that event in scheduled job. Scheduled job script should be like this
searchExparyDate();
function searchExparyDate(){
var qrystr = "active=true^valid_toBETWEENjavascript:gs.now()@javascript:gs.daysAgo(-7)";
var expdt = new GlideRecord("kb_knowledge");
expdt.addEncodedQuery(qrystr);
expdt.query();
while(expdt.next()){
gs.eventQueue('renew.kb',expdt,expdt.author,expdt.author.manager);
}
}
3.Create an event based notification and select param1,param2 contains recepient.
Thanks,
Mihir

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2016 03:16 AM
Hi Tony,
Take a look at https://share.servicenow.com and search for Knowledge or Knowledge Expire or Knowledge Renew. I'd include links, but the current release of Jive software doesn't support deep linking on that site at present. This seems to be a common question and I've often contemplated writing my own.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2019 12:03 AM
Hi there,
you can run daily scheduled job and add the below script in scheduled to run it before 7 days to expiry date.
var gr = new GlideRecord("kb_knowledge");
gr.addEncodedQuery('workflow_state=published^active=true^valid_toRELATIVEEE@dayofweek@ahead@7');
gr.query();
while(gr.next()){
gs.eventQueue('KM_Reminder',gr);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2020 05:42 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