How to retire child articles of versioned parent articles in Global Knowledge Base

Vikram Kee Dam2
Tera Expert

I have a requirement to retire all child articles (translated versions) when the parent workflow_state is set to retired by using the UI action for Retire. But I cannot seem to find a way to change the workflow state for the child articles.

The Knowledge Base follows Instant Retire Workflow-

I've tried creating a Business Rule to set the workflow state to Retired when a parent updates. Didn't change the workflow state.

I've tried using Flow Designer to create a simple flow that triggers when a record is updated to Retired, that does a look up to find records that has the trigger record as a parent and then attempts to update the field workflow_state to Retired. 

Lastly I tried to add a Run Script stage to the Instant Retire workflow in the workflow editor, but I couldn't get that to work either.

 

Is this something to do with it being the workflow_state field that needs to be changed? What is the best practice to deal with such a requirement? I'm out of options right now.

They have around 6 000 articles in the Knowledge Base in question and this should apply to all of them, when the parent articles is retired.

Thank you,

Vikram Kee Damslora Willoch

 

 

1 ACCEPTED SOLUTION

It's okay, I found the mistake. Because of different support in functionality on the version of the knowledge base, (2 and 3) I had to put it so the retire workflow is triggered in the script on the child articles.

        var gr = new GlideRecord("kb_knowledge");
        gr.addQuery("parent", current.sys_id);
        gr.query();

        while (gr.next()) {
            new KBWorkflow().startWorkflow(gr, "retire_workflow"); //This is the added line
            //gr.setValue("workflow_state", "retired");
            //gr.update();
        }

 

Taken straight from the Retire UI action

View solution in original post

5 REPLIES 5

Community Alums
Not applicable

Hi @Vikram Kee Damslora Willoch ,

Glad to see my answer helped You. 
Kindly mark the applicable answer as Correct & Helpful both such that others can get help.

Thanks,
Sandeep