Knowledge Base Article Expiration Notification

Chris Hoff
Kilo Explorer

I have been tasked to setup a notification in our instance to periodically search the Knowledge Base for articles that are set to expire in 30 days or less, and then notify the author of the article with an email notification letting them know to update/retire the article. So far as I have found in the forums, the best way to accomplish this is to setup a Scheduled Job script to periodically search the KB table for articles meeting the conditions, and within this script kickoff an event. Also, there is an email notification that fires off when this event occurs. I have done this in my dev instance, and according to my event logs, the event kicks off and collects the right info in the event parameters, but the email notification still is not being sent. They are all running off of the Knowledge table, but I'm not sure why the email does not get sent ( continuously check the Outbox for the emails because sending is turned off in my dev instance. Any suggestions? I have the scripts available if anyone cares to take a look.

 

Screenshots added as requested Message was edited by: Chris Hoff

1 ACCEPTED SOLUTION

Subhajit1
Giga Guru

Hi Chris,


I would suggest you try with a simple Notification first and then try Mail Scripts if the first on works.


Then, there is no need of gr.update().


Third:- Pass gr.author as parm1 and gr.number as parm2(without the display values).



Thanks,


Subhajit


View solution in original post

16 REPLIES 16

Subhajit1
Giga Guru

Hi Chris,


This may sound as obvious, but still, have you created the New Email Notification and the New Event (in Registry) to get fire the Email Notification?


Could you also please share your eventQueue function over here, so that it can be troubleshooted.



Thanks,


Subhajit


I have added screenshots of the Scheduled Job, the Event, and from the Email Notification. Thanks for looking into this, and I hope you are able to do some proper troubleshooting with what I have provided.


Who are you sending the notification to?   I'm assuming, from looking at the Scheduled Job screenshot, you have the "Event parm 1 contains recipient" option checked.   Is that correct?   Check out the event log (System Logs \ Events) to see what data is passed into your events.



And something else to check - are you expecting the email to go to you?   If so, is the "Send to event creator" field checked (Email Notifications - ServiceNow Wiki)?




That option ends up being the culprit a lot of the time.   Even though you may not want it checked once in production, you probably need it checked while testing the notification.


Subhajit1
Giga Guru

Hi Chris,


I would suggest you try with a simple Notification first and then try Mail Scripts if the first on works.


Then, there is no need of gr.update().


Third:- Pass gr.author as parm1 and gr.number as parm2(without the display values).



Thanks,


Subhajit