- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2021 07:09 AM
Dear Experts,
I am trying to set an email notification.
Send an Email if the KB article is going to retire in the next 7 days. Even though I have three KB articles expiring in 7 days I email did not trigger.
Please help!
Thank you..
Is my condition correct?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2021 06:01 AM
Hi,
I just wanted to check-in on this and see if my reply above helped recap everything and guide you Correctly.
If so, please mark my above reply as Correct.
Thanks! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2021 12:23 PM
Is there a way to create a Business rule instead of Schedule Job to trigger KB expiring after 1 day email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2021 12:30 PM
Yes
We use eventQueue() method.
eventQueue() method inserts an event in an event queue. The eventQueue() method is typically passed four parameters but can also take an optional 5th parameter
- Event name. Enclose the event name in quotes.
- GlideRecord object, typically current but can be any GlideRecord object from the event's table.
- Any value that resolves to a string. This is known as parm1 (Parameter 1). Can be a string, variable that resolves to a string, or method that resolves to a string.
- Any value that resolves to a string. This is known as parm2 (Parameter 2). Can be a string, variable that resolves to a string, or method that resolves to a string.
- (Optional) Name of the queue to manage the event.
To Trigger Event from business rule, syntax is :
gs.eventQueue('Event_Name',current, param1,param2);
Regards
Prasad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2021 12:47 PM
Hello,
Business rules will only run once a record is updated or inserted, essentially...so they will not run daily...on a schedule...to do what you want to do. Hence why the discussion has been around creating a scheduled job script execution and firing the event.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2021 01:11 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2021 01:34 PM
Hi,
Sorry, your thread here has sort of been all over the place and this really shouldn't need 14+ replies to get you setup.
So I'll recap some stuff here for you:
1) You can't rely on the out of box scheduled job to warn people of knowledge articles expiring because that only runs once a month and doesn't meet your need of warning them that their article is about to expire in 7 days.
2) You would need to create your own scheduled job script to run (daily?) to check and see if a knowledge article is within 7 days from now.
3) The script for can easily be derived from you going to your knowledge articles and filtering the list to show articles with a valid to date after 6 days from now, but also a valid to date before 8 days from now. So...that would pinpoint the "7" days. This makes it so you aren't querying and using a while loop to then decide if it's a relevant article or not...
The script could look like this:
var gr = new GlideRecord('kb_knowledge');
gr.addEncodedQuery("valid_toRELATIVEGT@dayofweek@ahead@6^valid_toRELATIVELT@dayofweek@ahead@8");
gr.query();
while (gr.next()) {
gs.eventQueue('name_of_event', gr, gr.author.email, gr.author.manager.email);
}
So this would include the author in the parm1 and author's manager in the parm2.
Within your notification, you'd want to set it up to trigger when 'x' event is fired and in the "who to send to" tab, you'd pick parm1 contains recipients, and parm2 contains recipients.
So that's the general idea. Please refer to this as an example and take it from there.
So now when this scheduled job script runs every day...it'll send an email to those people for that article.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!