Knowledge Publish Flow reads old KB and Category values when publishing an Incident-created article

shutoishizu
Tera Contributor

Hi Community,

I am investigating an issue with Knowledge Management where a Publish Flow receives previously saved database values when a Knowledge article created from an Incident is published without first saving the changes.

 

Scenario

An OOTB Incident-created Knowledge article is initially stored as:

 - Knowledge Base: Source Knowledge Base
 - Category: null
 - State: Draft

The user then opens the article and changes:

 - Knowledge Base: Target Knowledge Base
 - Category: Target Category

Without clicking Update, the user directly clicks Publish.

 

The Publish Flow configured on the Target Knowledge Base is correctly triggered. However, inside the Publish Flow, the Knowledge record contains the previously saved database values:

 - Knowledge Base: Source Knowledge Base
 - Category: null

 

I confirmed this by logging the kb_knowledge_base and kb_category values inside the Publish Flow.

 

OOTB processing identified

The Publish UI Action eventually calls:

new global.KnowledgeUIAction().publish(current);

KnowledgeUIAction extends KnowledgeUIActionSNC, and the actual publish processing is implemented in:

System Definition > Script Includes > KnowledgeUIActionSNC > publish()

 

For a Knowledge Base with Release version 3 and a Publish Flow configured, KnowledgeUIActionSNC.publish() starts the Publish Flow through:

new KBFlow().startFlow(articleGr, this.PUBLISH_FLOW)

The record update:

articleGr.update()

occurs later in the processing.

 

Based on this processing and the observed behavior, it appears that the Publish Flow is selected using the Knowledge Base value held by the current articleGr object. This would explain why the Publish Flow configured for the newly selected Target Knowledge Base is started even though that Knowledge Base change has not yet been persisted to the database.

 

However, once the Flow starts, the Knowledge record appears to be queried again from the database. Since the form changes have not yet been persisted, the Flow receives the previously saved values:

 - Knowledge Base: Source Knowledge Base
 - Category: null

The OOTB comments in KnowledgeUIActionSNC also mention that Flow does not necessarily update the same record object and may query the provided GlideRecord reference from the database.

 

Impact

Our custom Ask for Approval logic determines the approval group based on kb_category.

Since kb_category is null in the Flow:

 1. The approval group cannot be determined.
 2. The approval rule returns an empty value.
 3. Ask for Approval treats the rule as invalid.
 4. The approval is skipped.

 

Workaround

The issue does not occur when the user performs:

Set Knowledge Base / Category → Update → Publish

Once the changes are persisted before Publish, the Flow retrieves the expected Knowledge Base and Category values.

 

Questions

Is this expected OOTB behavior for a Knowledge Base with Release version 3 and a Publish Flow configured?

Specifically:

 1. Is it expected that unsaved form values can be used to select the Publish Flow, while the Flow itself retrieves the previously saved Knowledge record from the database?
 2. Is there an OOTB mechanism to persist the current Knowledge form values before the Publish Flow starts?
 3. What is the recommended approach when a Publish Flow needs to evaluate fields such as kb_category that may have been changed immediately before the user clicks Publish?

 

I would prefer to avoid customizing KnowledgeUIActionSNC because of upgrade and maintenance concerns.

Any guidance or confirmation would be appreciated.

0 REPLIES 0