Need to send a notification to Author and KB owner for expiration of knowledge article?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 02:29 AM
Hi Al
I have a requirement that need to send send a email notification to "Author ,KB owner and content owner" Whenever a knowledge article reaches 60 and 30 days before Valid to date?
If need to send warning notification exactly if valid to have due in 60 days and if due in 30 days also?
please help me to achieve to this
Thanks
Ramu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 03:05 AM
You can do it using scheduled job and a notification.
Create a schedule job to check this condition , run it daily and trigger the notification.
Try it then share the screenshots if you stuck anywhere to help you better.
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 03:14 AM
Thanks for the response
i have created this schedule job but this condition not work for me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 03:33 AM - edited 10-27-2023 03:34 AM
If I read your requirement correctly then it means you need to send notification after 30 & before 60 days of knowledge's valid to. Then try following code which will give you desired results:
var gr = new GlideRecord('kb_knowledge');
gr.addEncodedQuery("valid_toRELATIVEGT@dayofweek@ahead@30^valid_toRELATIVELT@dayofweek@ahead@60");
gr.query();
while (gr.next()) {
gs.eventQueue('sn_hr_core.knowledge expiry', gr, gr.author, gr.kb_knowledge_base.owner);
}
Make sure you have records falling in this criteria before testing:
https://<instance_id>.service-now.com/kb_knowledge.do?sys_id=471ee81eff6002009b20ffffffffff34&sysparm_view=&sysparm_domain=null&sysparm_domain_scope=null&sysparm_record_row=3&sysparm_record_rows=34&sysparm_record_list=ORDERBYDESCnumber
replace <instance_id> with your instance name
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 03:38 AM
thanks for the code
Actually my requirement if the due is 60 days or due is 30 days for valid to date , we need to send a notification ?