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

Like Subhajit Das said, try a simple notification first.



And, to be honest, you really do not need any of the mail_script code you have in there.   You already have access the the KB Article record because it was passed into the event as a GlideRecord object from the call to gs.evenQueue, so there's no need to query for it.   Since the Notification is "running" on that GlideRecord, you can just refer to it's fields to get the data you need.   With that being said, you do not even really need to pass the expiry date nor the author's email address into the event because you can easily read it from the KB Article record itself.



The following text in the Message field should output what you want:



Article expires: ${valid_to} - ${URI_REF} - ${short_description}


JohnJasinski
Tera Expert

Hi Chris - I'm sure you'll be able to solve this one, I can't, but I can offer color commentary for a conversation with the process owner.   Think of Google as a KB.   They don't bother the authors.   In my opinion the approach is over engineering the process.   I suggest your process owner could be spending time better looking at views, use, flags, comments and ratings.   Maybe they already do.     And talk about if the KB is helping other processes and improvement opportunities.   Just my two cents on working smarter not harder.   Good luck on your solution.   Keep up the good work.     🙂


ps - look at ITIL, KCS and COBIT 5 for guidance on KM


Chris Hoff
Kilo Explorer

Thanks all for the input. I have followed the suggestions provided, and I have gotten the email notification to fire off successfully. However, it is only sending to me due to the fact that I have selected the "Send to event creator" field in the email notification. I have tried different values (author, author.email, author.name) for the event.parm1 to send to the author of the KB article in question, and I have also selected the Author value manually in the Users field of the notification to no avail. How can I send the email to the author of the KB article queried by the scheduled script to receive the notification? This is the last piece of the puzzle, and if I can get this to work it would be a big win for my team. Any further assistance will be most appreciated.


Just to be clear, here is the definition of the "Send to event creator" option from the Wiki:



Select this check box to send the notification to the person who performed the action that started the notification process if the person is also specified in the Users/groups in fields, Users, or Groups field. If the event creator is not specified in one of these fields, the event creator does not receive a notification regardless of the setting in this field.



Are you receiving every single email?   There is a property that overrides the email recipients and sends them all to a particular address (or addresses).   Click on the System Properties \ Email module and look for the following property:


Mail_Properties.png


The wording is a little bit different depending on the version of your instance.   If there is an email address in that field, it will receive all emails.


Thanks Jim for your input. I definitely had the catch-all email address in place in my Dev instance, but I am on the email list there, so that wasn't the issue. It turns out that I needed the "Send to event creator" box checked for this notification to work. I am getting this process to work successfully now in my Production and non-production instances, so thanks to all for providing input as to how to best tackle this issue!