How to create a email notification for expiring "valid to" date?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2022 06:44 AM - edited ‎11-30-2022 06:47 AM
Hi,
I want to create a few email notifications for expiring "valid to" dates of Knowledge Base Articles.
How can I do this? I have tried to do this with a simple notification + condition, but it does not work.
It seems that I need to create something like an event first. I want a total of three notifications;
- 6 weeks before expiration date (the "valid to" date)
- 4 weeks before expiration date (,,)
- 2 weeks before expiration date (,,)
Is this possible and how do I do this? Thanks in advance for the help!
Best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2022 06:50 AM
There's an existing OOTB notification that you just need to activate
Email notifications for expiring knowledge articles
The email notifications for expiring knowledge articles are available when your administrator activates the Knowledge Management Core plugin (com.glideapp.knowledge) and sets the value of the glide.knowman.enable_article_expiry_notification property to true. By default, the property value is set to false.
Knowledge articles have an expiration date set using the Valid to field when creating the article. Articles do not appear in search results after the Valid to date.
On the first day of each month, the application sends an email notification to a list of authorized recipients to remind them about articles that are scheduled to expire in the next month. The user can then determine whether to extend the Valid to date to continue providing access to the article.
- Up to 10 – The email notification includes a list of article links displayed in a tabular format and arranged in ascending order by their Valid to date. Clicking a link opens the article in Now Platform.
- More than 10 – The email notification includes a View the list of expiring articles link, which when accessed opens a list in Now Platform of all articles expiring in the next month.
The following table describes the recipient list of notifications for expiring knowledge articles and the associated conditions when a notification is sent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2022 06:57 AM
Hi Adam,
You need to create a Schedule Job which should run daily to check for the 3 conditions.
For each success condition call gs.eventQueue and trigger the Notification.
to check for the condition, go to the KB Article List and in the Filter condition it and run, then GlideRecord with same filter condition.
This will solve your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2023 04:26 AM - edited ‎04-20-2023 04:46 AM
Sadly this seems pretty complex.
I have no solution yet.
I have tried to implement the solution of Madhava, but I cannot set the condition. Conditions like these ones here below, are not accepted ;
- workflow_state=published^valid_toLESSTHANvalid_to@week@before@6
- workflow_state=published^valid_toLESSTHANvalid_to@week@before@4
- workflow_state=published^valid_toLESSTHANvalid_to@week@before@2
The error messages I get, are:
- "Parsing error: Unexpected character '@' "
- "Could not save record because of a compile error: JavaScript parse error at line (1) column (50) problem = missing ; before statement (<refname>; line 1)"
This is my Scheduled Script Execution / Scheduled Job:
var KBarticle = new GlideRecord("kb_knowledge");
KBarticle.addActiveQuery();
KBarticle.addEncodedQuery("workflow_state=published^valid_toLESSTHANvalid_to@week@before@6");
KBarticle.query();
while(KBarticle.next()){
gs.eventQueue("adam_expiring_kbarticle_notification",KBarticle, KBarticle, "", "");
}
And this is my Event Registration / Event: