- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 01:11 PM
Can I run the instant publish on articles already in draft state?
The articles have been created and vetted by our Knowledge team so I just need to move them to a published state. Is this possible?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2017 08:55 AM
Okay, this is hastily knocked up, and seems to work on articles that are currently draft but NOT "review":
(edited - <pre> tags barfed)
gs.log("1. Starting 'update-kb' script","UPDATE-KB");
gs.setSession.setStrictQuery(true);
// -- first, we use a GlideRecord against the Knowledgebase table
var pending = new GlideRecord('kb_knowledge');
// -- create our query:
pending.addEncodedQuery('workflow_state=draft^ORworkflow_state=review');
// -- call that query:
pending.query();
gs.log("2. found " + pending.getRowCount() + " records to update.","UPDATE-KB");
// -- now update each record found:
while(pending.next())
{
// -- flick workflow state over
gs.log("3. changing: " + pending.number + " to PUBLISHED.","UPDATE-KB");
pending.workflow_state = 'published';
pending.update();
}
gs.log("4. Completed script","UPDATE-KB");
This should write out to your script log, but under a different "source" so it should identify the records that have been amended, should you need an audit trail. I trust you'll run it on a testbed first!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2017 07:18 PM
Ahh, so I can edit the action on selected rows button to include "publish" you're saying? Sounds viable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2023 05:58 AM
Publish "Draft" and "Review" state articles:
Currently there are 877 KB articles persist in our service now repository. In total, 486 KB articles are in "Draft" and "Review" state, which are created from problem as a source task. These KB articles should be published. Currently there are few difficulties to chase each KB authors to publish from their end. So, requesting service now team to publish it from backend. in the approval stage no longer required