Need to send a notification to Author and KB owner for expiration of knowledge article?

Ramu6
Tera Contributor

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

 

10 REPLIES 10

sushantmalsure
Mega Sage
Mega Sage

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.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

@sushantmalsure 

Thanks for the response

i have created this schedule job but this condition not work for me

var gr = new GlideRecord('kb_knowledge');
gr.addEncodedQuery("valid_toRELATIVELT@dayofweek@ahead@60^ORvalid_toRELATIVELT@dayofweek@ahead@30");
gr.query();
while (gr.next()) {
gs.eventQueue('sn_hr_core.knowledge expiry', gr, gr.author, gr.kb_knowledge_base.owner);
}
Thanks
Ramu

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

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

@sushantmalsure 

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 ?