Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Notification for an Expiring Knowledge Article

cnharris1
Kilo Sage

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?

1 ACCEPTED SOLUTION

Archana Reddy2
Tera Guru

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

View solution in original post

10 REPLIES 10

Glad to hear that 🙂