- 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 03:29 AM
var ka = new GlideRecord('kb_knowledge');
ka.addQuery('valid_to',<=', gs.daysAgo(-30)); // you need to add <= here
ka.query();
while(ka.next())
{
var exp = new GlideDateTime(ka.valid_to).getDate(); //Considered valid_to as Article Expiry Date
gs.log("valid date : "+exp);
exp.addDays(0);
gs.eventQueueScheduled("kb.article.remainders", ka, "", "",exp);
ka.update();
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 03:41 AM
Hi @Harish KM ,
Thanks for the response.
I will try to implement the above script.
Q: In 'cc' section, If support group begins with a word "KB" then include PQR group and KBA expiration date in MM/DD/YYYY format . Please help me on these mail scripts.
Thanks,
Sukanya

- 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-13-2023 03:37 AM
Hi @Harish KM ,
Thank you for your response.
The above logic for date format is working as expected.
Thanks,
Sukanya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2023 06:54 PM