Schedule the publishing of a Knowledge Article
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2019 01:20 AM
Hi
Does anyone know if you can schedule the publication of a Knowledge Article? I want to be able to create an article on one day and arrange for it to be published on any date in the future that I choose.
Thanks
- Labels:
-
Case and Knowledge Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2019 04:59 AM
I don't see why this could not be a thing - with a scheduled job. What you could do is, create a new Date type field on your KA form. You can call it, 'date to be published'. I currently have something similar with our KAs with our News Widget. I have the system run a scheduled job daily, look at the KAs with our new field for when it needs to remove it from the news widget, by changing the Topic field from News to General. This way, it stays active but no longer needs to be on the news widget.
It's not exactly what you are looking for, however could get you going in the direction to which you need yours to be.
Scheduled Job:
var gr = new GlideRecord('kb_knowledge');
var gdt = new GlideDate();
var checkDate = gdt.getDate();
var today = new GlideDate();
today = today.getDisplayValue();
gr.addEncodedQuery('u_news_widget_expirationONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^topic=News');
gr.query();
while(gr.next()) {
var expiration = gr.u_news_widget_expiration.getDisplayValue();
gs.info("Expiration" + expiration);
if (expiration == today){
gr.setValue('topic', 'General');
gr.update();
}
}
My new field on the KA form is the New Widget Expiration
Business Rule: For the BR, was is created to automatically add the number of days we want the KA to show on the news widget. This BR will create the future date into the new field, which is then controlled by the scheduled job above for when this date is matched. However for you to pick a future date to be published - you could just enter in the date manually, and then let the scheduled job do what you need.
(function executeRule(current, previous /*null when async*/) {
var gdt = new GlideDateTime(current.getValue('published'));
gdt.addDays(14);
//gs.addInfoMessage(gdt);
current.u_news_widget_expiration=gdt;
})(current, previous);
I Hope this helps - at least gets you in the direction you need.
Cheers!
-Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2019 07:33 AM
Thanks Rob, I appreciate your reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2022 09:54 AM