- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 02:17 AM
To: Content Owning groups email, Knowledge Management Group DL ,Group manager. (If no group DL available, please send to all group members and group manager)
CC: Please include the members of XYZ group and add the support group’s SDL’s email. If support group begins with a word "KB" then include PQR group.
Subject: Reminder, KBA expires in 30 days. Review of (Insert KBA number) Owned by “ServiceNow support group name”.
Hello (Insert ServiceNow support group name),
Please review the Knowledge Article (Insert KBA number) at the earliest and share your response whether the content is valid on its current state or if it require updates. You can also confirm in case any knowledge article need to be retired.
Note: If no action is taken, this KBA will be expired on {KBA expiration date in MM/DD/YYYY format} and will no longer be available in the ServiceNow Knowledge Base.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 06:32 PM - edited 10-08-2023 06:32 PM
Hi @sukanya kotni from where does the support grp field come? You can do like this below
var grp = current.support_group;
var grp = 'kb';
if(grp.indexOf('kb') > -1)
{
gs.info("KB group found);
// your logic here
}
else if(grp.indexOf('PQR') > -1)
{
gs.info("PQRgroup found);
// your logic here
}
to get date format use below logic
var date;
var format;
var kb = new GlideRecord('kb_knowledge');
kb.addQuery('sys_id','d22ce0b197987110df5db8a3f153af47'); // pass article sysid
kb.query();
while(kb.next())
{
date = kb.valid_to;
format = date.getByFormat("MM-dd-yyyy"); // getbyformat
gs.info(format);
}
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2023 06:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 02:56 AM
Hi,
1. Create a event in Event Registry. Select table as kb_knowledge.
2. Create a notification and call the event in When to send. For recipients create email script to add people in To and CC.
3. Create a scheduled job to run daily and check articles expiring after a month. Send email to author and other recipients.
var ob = new GlideRecord('kb_knowledge');
ob.addQuery('valid_to', '>=', gs.daysAgo(-30));
ob.addEncodedQuery('workflow_stateNOT INdraft,retired');
ob.query();
while(ob.next())
{
gs.eventQueue('email.validity',ob);
}
Please mark the answer as Helpful / Correct, if it helped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2023 07:51 AM
Hi @Chandresh Tiwa2 ,
I tried above scheduled job but it is working. Here notification shouls send the email for when article expiry date before exact 30 days.
Thanks,
Sukanya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 02:56 AM - edited 10-06-2023 03:09 AM
Hi @sukanya kotni you can create a schedule job which checks daily and create a event which triggers the Notification. In Notification you can specify who should receive the email
Example schedule job script
doit();function doit(){
var gr = new GlideRecord('kb_knowledge');
gr.addQuery("workflow_state", "published");
gr.addQuery("valid_to", "<=", gs.daysAgoStart(-30));//equal to 30 days
gr.query();
while (gr.next()){
gs.eventQueue("kb.expired20", gr, "", ""); // event to fire notification
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 03:25 AM
Hi Harish,
Thanks for your response.
We have tried the below script. It is running today's expiry date.
Please help me on email script for the Date format.