How do I revert a published Knowledge article back to draft status?

Community Alums
Not applicable

How do I revert a published Knowledge article back to draft status?

Is the only way to make a published Knowledge article temporarily private is to deactivate it?

1 ACCEPTED SOLUTION

Harish KM
Kilo Patron
Kilo Patron

Here is a background script which does that

var kb = new GlideRecord('kb_knowledge');
kb.addQuery('sys_id','f6a3f2091ba8911009ad9758b04bcb7b');

kb.addQuery('workflow_state','published');
kb.query();
if(kb.next())
{
kb.workflow_state= 'draft';
kb.setWorkflow(false); //Do not run business rules
kb.autoSysFields(false); //Do not update system field
kb.update();
}

Regards
Harish

View solution in original post

2 REPLIES 2

Harish KM
Kilo Patron
Kilo Patron

Here is a background script which does that

var kb = new GlideRecord('kb_knowledge');
kb.addQuery('sys_id','f6a3f2091ba8911009ad9758b04bcb7b');

kb.addQuery('workflow_state','published');
kb.query();
if(kb.next())
{
kb.workflow_state= 'draft';
kb.setWorkflow(false); //Do not run business rules
kb.autoSysFields(false); //Do not update system field
kb.update();
}

Regards
Harish

Harish KM
Kilo Patron
Kilo Patron

You can use User Criteria on Knowledge article to control the visibility of the article

 

Refer doc

https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/product/knowledge-management/task/t_SelectUCArticle.html

Regards
Harish