- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2018 09:22 AM
Is there a way to send out a simple notification to the authors of a knowledge article to let them know that their article is about to expire? If so, how would I go about doing that?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2018 10:02 AM
Hi,
A Scheduled Job can do your work. Try with the below one.
var ka = new GlideRecord('kb_knowledge');
ka.query();
while(ka.next())
{
var exp = new GlideDateTime(ka.exp_date).getDate(); //Considered exp_date as Article Expiry Date
if(exp.addDaysUTC(7)==new GlideDateTime().getDate())
{
gs.eventQueue('your_event_name',ka,gs.getUser()); //Include the recepients you require
}
}
//Running this Scheduled Job daily will send notification 7 days before the ExpiryDate
//You have to create a notification to be triggered when 'your_event_name' is triggered
Hope this helps!
Thanks,
Archana

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2018 09:33 AM
if your recipient is dynamic, for ex, based on author, You can write a scheduler script to identify all the articles expiring in next 7 days and send them a reminder using gs.eventQueue.
if it is just the knowledge admins, you can also schedule a report, and send a spreadsheet to the Knowledge admins abut expiring.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2018 01:17 PM
Thanks Sanjiv for pointing me in the right direction.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2018 10:02 AM
Hi,
A Scheduled Job can do your work. Try with the below one.
var ka = new GlideRecord('kb_knowledge');
ka.query();
while(ka.next())
{
var exp = new GlideDateTime(ka.exp_date).getDate(); //Considered exp_date as Article Expiry Date
if(exp.addDaysUTC(7)==new GlideDateTime().getDate())
{
gs.eventQueue('your_event_name',ka,gs.getUser()); //Include the recepients you require
}
}
//Running this Scheduled Job daily will send notification 7 days before the ExpiryDate
//You have to create a notification to be triggered when 'your_event_name' is triggered
Hope this helps!
Thanks,
Archana

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2018 06:45 AM
Thanks for the post. I used your script and modified it a bit to. Less rows and easy to manage by using Copy Query from a list filter instead of going through all records in the table.
But since I found your script here, I'll post my script here to if someone would like to use it.
System Scheduler -> Scheduled Jobs
//Running this Scheduled Job daily will send notification 7 days before the ExpiryDate
var ka = new GlideRecord('kb_knowledge');
//valid to on next week and workflow is not retired or outdated
ka.addEncodedQuery('valid_toONNext week@javascript:gs.beginningOfNextWeek()@javascript:gs.endOfNextWeek()^workflow_stateNOT INretired,outdated');
ka.query();
while(ka.next()){
gs.eventQueue('my_expiring_knowledge_articles', ka, ka.author.email, ka.author.email);
}
The email is sent to the author of the article in the params filed.
Cheers!