Notification for an Expiring Knowledge Article
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 05:06 AM
Hi I would like to send an automatic message to the author 14 days before his article expires.
I've already found a script, but I don't really know how to use it and what event to create.
https://community.servicenow.com/community?id=community_question&sys_id=9778cb39db7adb4067a72926ca961999
Are there other and easier methods to solve this?
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
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2019 01:55 AM
Hello I have changed that, but the event is still not executed, what could be the reason?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 05:41 AM
I am going to offer two scriptless options. One is an update set I created to allow you to do just this with a scheduled job and no script.
The other is to use Flow Designer, which allows you to run scheduled jobs an lookup records, then send notifications (without generating an event.)
of the two, I suggest the latter.