Publish a knowledge article

phr
Tera Contributor

Even though the knowledge article is published. the workflow state is still in "Review". I did make use of the fix script to fix this but we have same knowledge article number  with different versions. What is the fix script code that i need to make use of in order to publish an article with specific version?

The code i used : 

 

var kb = new GlideRecord("kb_knowledge");
kb.addEncodedQuery(""); // change the article number
kb.query();
if(kb.next()){
kb.workflow_state="published";
kb.update();
kb.setWorkflow(false);
}

 

Need to publish the one which is highlighted below. How do i copy the encoded query with version?

phr_0-1717070740936.png

 

1 REPLY 1

Mark Manders
Tera Patron

Include the version in it (or order by the last updated if you need more updates than just one).