- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2021 06:59 AM
Hello,
We are trying to get Kb article authors to update publication every 90 days.
We did not see anything OOB that would allows to do send notification 90 days after Kb article is 'published', but we found Scheduled Script Execution: Notification for Article Expiry Warning.
Is it possible to modify the script below to lookup the 'published date' instead of 'expired date'? I am new to this, i will greatly appreciate any help. thanks.
Condition:
answer = false;
if (gs.getProperty("glide.knowman.enable_article_expiry_notification", "false")==="true") {
var gr = new GlideRecord('kb_knowledge');
gr.addEncodedQuery('workflow_stateINpublished^valid_toONNext month@javascript:gs.beginningOfNextMonth()@javascript:gs.endOfNextMonth()');
gr.query();
answer = gr.next();
}
Run this script:
new KBKnowledge().notifyForExpiringArticles();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2021 07:31 AM
Hi,
like this
Remember to Save and Activate the Flow
Final Flow
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2021 10:09 PM
you want link to KB but in your script you have given link to sysapproval
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2021 11:34 PM
Is this the right table?
https://dev.service-now.com/nav_to.do?uri=kb_knowledge.do sys_id=5b145463db38f410afe6af6d13961939
(function execute(inputs, outputs) {
var gr = new GlideRecord('kb_knowledge');
gr.get(inputs.knowledge);
var instance_name = gs.getProperty('instance_name');
outputs.url1 = '<a href = "https://' + instance_name + '.service-now.com/nav_to.do?uri=kb_knowledge.do?sys_id=' + gr.sys_id + '">' + gr.kb_knowledge.number + '</a>';
})(inputs, outputs);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2021 11:39 PM
Hi,
seems fine
update as this
gr.number
(function execute(inputs, outputs) {
var gr = new GlideRecord('kb_knowledge');
gr.get(inputs.knowledge);
var instance_name = gs.getProperty('instance_name');
outputs.url1 = '<a href = "https://' + instance_name + '.service-now.com/nav_to.do?uri=kb_knowledge.do?sys_id=' + gr.sys_id + '">' + gr.number + '</a>';
})(inputs, outputs);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2021 10:02 PM
Hi
No luck creating the hyperlinked number, i did not even get an error message.
Script
Flow designer
I know trigger > knowledge record > number works in the subject line, but not in the email body as a hyperlinked number. this is really confusing.
Body of email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2021 10:14 PM
Did you check what is the output of that Generate Link action?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader