Is it possible to Retire a KB article that is in 'Review' workflow state?

subhadeep1618
Tera Guru

Hello Everyone,

I would need a quick help and/or clarification, regarding a customer requirement that I have recently received.

We have around 200 KB articles which are in 'Review' state since more than 1 year.

Customer wants us to retire these KB articles.

But the UI action of Retire is only available for published articles, not for 'reviewed' articles'.

So, here is my question: is there any way to retire KB articles that are in review state?

Please let me know.


Please mark this post as a solution and also as helpful, if this resolves your issue or query.

Thanks,
Subhadeep Ghosh.
1 ACCEPTED SOLUTION

Harish KM
Kilo Patron
Kilo Patron

Hi @subhadeep1618 you can retire those articles through background script:

script:

var kb = new GlideRecord('kb_knowledge');
kb.addEncodedQuery('workflow_state=review');//filter by review
kb.query();
while(kb.next())
{
kb.workflow_state = 'retired';// set to retire
kb.update();
}

Regards
Harish

View solution in original post

5 REPLIES 5

Harish KM
Kilo Patron
Kilo Patron

Hi @subhadeep1618 you can retire those articles through background script:

script:

var kb = new GlideRecord('kb_knowledge');
kb.addEncodedQuery('workflow_state=review');//filter by review
kb.query();
while(kb.next())
{
kb.workflow_state = 'retired';// set to retire
kb.update();
}

Regards
Harish

Thanks @Harish KM ,

Yes, I had also tried with same approach before posting this question - i.e., through back-end script, and it worked.

But is this a ServiceNow best practice?


Please mark this post as a solution and also as helpful, if this resolves your issue or query.

Thanks,
Subhadeep Ghosh.

Hi @subhadeep1618 when the article goes to review state, it will go through approval process, so approver can decide whether he needs to publish this article or he can set it back to draft /retired. That's the process, in your case I think background script should do since you want to mass update the records.

 

Regards
Harish

Thanks @Harish KM for your time.

Yes I think you're correct - scripting might be the only option in this case.


Please mark this post as a solution and also as helpful, if this resolves your issue or query.

Thanks,
Subhadeep Ghosh.