Notification for an Expiring Knowledge Article

florian29
Tera Contributor

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
11 REPLIES 11

Hello I have changed that, but the event is still not executed, what could be the reason?

Chuck Tomasi
Tera Patron

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.

Scriptless scheduled jobs

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.

Flow Designer