Knowledge Management: KM Bulk Operations & Mass Publishing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago
Hi all,
I want to know about the bulk publication of knowledge articles, actually i need to create the ATF for that but i'm not able to create bulk articles. Is it possible through OOB.
ATF:
| KM Bulk Operations & Mass Publishing |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago
Hi @Devansh00 ,
Yes, you can create an ATF for this scenario, but I would separate the requirement into:
1. Create multiple draft Knowledge Articles
2. Execute the bulk Publish action
3. Validate that all selected articles reached the expected workflow state
For creating multiple KB articles, you do not need to create them manually through the Knowledge form.
Recommended ATF approach:
Step 1 - Create the Knowledge Base test data
Use:
ATF
-> Add Test Step
-> Server
-> Record Insert
Create or reference a Knowledge Base configured with:
Publish workflow:
Knowledge - Instant Publish
Using Instant Publish is important if your expected result is:
Draft
-> Published
If the Knowledge Base uses:
Knowledge - Approval Publish
then clicking Publish should move the articles into the approval/review process instead of immediately publishing them.
Step 2 - Create multiple Knowledge Articles
Use multiple:
Record Insert
steps against:
Knowledge [kb_knowledge]
For example create:
KB Article 1
KB Article 2
KB Article 3
Set fields such as:
Knowledge base:
<Test Knowledge Base>
Short description:
ATF Bulk Publish Article 1
Text:
ATF test content
Workflow:
Draft
You only need a small number such as 3 articles to validate the bulk behavior.
There is no value in creating hundreds of Knowledge Articles inside an ATF just to verify the same list action.
ATF should validate the functionality, not load-test the Knowledge Management application.
Step 3 - Open the Unpublished Knowledge list
Navigate to:
Knowledge
-> Articles
-> Unpublished
or use the ATF list navigation step for:
Table:
kb_knowledge
with a filter similar to:
Knowledge Base = <Test Knowledge Base>
AND
Workflow = Draft
Step 4 - Execute the List UI Action
Australia ATF provides:
Click a List UI Action
This supports list actions such as:
- List banner button
- List bottom button
- List context menu
- List choice
- List link
For a List Choice action, ATF supports applying the action against selected records.
Therefore, if Publish is available as a List Choice on kb_knowledge, configure:
List UI Action:
Publish
Apply to:
Selected / Multiple records
and select the records created earlier in the test.
Important:
Out of the box, the Knowledge Publish action is primarily a form action in many configurations.
There is an older accepted ServiceNow Community solution where the OOB Publish UI Action on:
Knowledge [kb_knowledge]
was configured with:
List choice = true
This exposes Publish at the bottom of the Knowledge list, allowing users to select multiple articles and publish them together.
However, I would NOT modify the OOB Publish UI Action directly in production just for an ATF.
First check whether your current release/application version already exposes an appropriate bulk/list Publish action.
Navigate to:
System Definition
-> UI Actions
Filter:
Table = kb_knowledge
Name = Publish
Check whether:
List choice = true
or whether another OOB Knowledge bulk action exists in your instance.
If Publish is not available as a list action, then there is no OOB list control for ATF to click in that configuration.
Step 5 - Validate the articles
After executing Publish, use:
Record Validation
or
Run Server Side Script
and confirm all three test records reached the expected state.
Example server-side validation:
var kb = new GlideRecord('kb_knowledge');
kb.addQuery(
'knowledge_base',
'<TEST_KB_SYS_ID>'
);
kb.addQuery(
'short_description',
'STARTSWITH',
'ATF Bulk Publish Article'
);
kb.query();
var failed = [];
while (kb.next()) {
if (kb.getValue('workflow_state') != 'published') {
failed.push(
kb.getValue('number')
);
}
}
if (failed.length > 0) {
stepResult.setFailed();
stepResult.setOutputMessage(
'Articles not published: ' +
failed.join(',')
);
} else {
stepResult.setSuccess();
stepResult.setOutputMessage(
'All test Knowledge Articles were published.'
);
}
Use the actual ATF server-side test-step APIs available in your instance for success/failure output.
Important:
Do NOT simply use:
kb.workflow_state = 'published';
kb.update();
inside the ATF to test publishing.
That only tests a direct database update.
It does NOT validate the actual Knowledge Publish UI Action / Knowledge publish workflow.
If your test requirement is specifically:
KM Bulk Operations & Mass Publishing
then the useful test should exercise:
Multiple Draft Articles
-> Bulk Publish UI/List Action
-> Knowledge publishing logic
-> Verify resulting state
not:
Multiple Draft Articles
-> Background script changes workflow_state
Also remember:
Knowledge - Instant Publish
-> Expected result = Published
Knowledge - Approval Publish
-> Expected result = Review / approval flow
so build the assertion according to the Knowledge Base Publish workflow.
Recommended ATF structure:
Create Test KB / obtain existing test KB
-> Insert KB Article 1
-> Insert KB Article 2
-> Insert KB Article 3
-> Navigate to Unpublished list
-> Select created records
-> Click Publish list action
-> Validate all article states
-> ATF rollback removes test data
Official ServiceNow references:
ATF List UI Actions:
https://www.servicenow.com/docs/r/application-development/automated-test-framework-atf/atf-list-ui-a...
Knowledge publishing behavior:
https://www.servicenow.com/docs/r/servicenow-platform/knowledge-management/edit-knowledge-article.ht...
Knowledge Base publish workflows:
https://www.servicenow.com/docs/r/servicenow-platform/knowledge-management/create-a-knowledgebase.ht...
Related accepted ServiceNow Community solution for bulk publishing:
https://www.servicenow.com/community/itsm-forum/publish-knowledge-articles-on-import/m-p/377879
One final point:
If you mean "Is bulk Publish itself available completely OOB?"
I would first check your current kb_knowledge Publish UI Action.
Older ServiceNow implementations required enabling the Publish action as a List Choice to perform multi-select publishing from the list.
So I would not claim mass publishing is universally exposed OOB in every current Knowledge configuration without checking the UI Action in your instance.
But ATF definitely supports testing a List UI Action against multiple selected records when that list action is available.
Hope this helps!
If this response helped, please mark it as Helpful.
If it resolves your issue, please Accept it as Solution.
Kind Regards,
Abhishek Pal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago
Hi @Devansh00 ,
For KM Bulk Operations & Mass Publishing, the key point is that ServiceNow does not provide a standard OOB "Mass Publish Knowledge Articles" feature in the same way list updates exist for some other tables. The publish action is primarily driven by the Knowledge article workflow and is often available as a form action rather than a true bulk operation.
For your ATF scenario
You do not need to create hundreds of articles.
A recommended ATF design would be:
Create a test Knowledge Base
- Set workflow to Knowledge - Instant Publish.
- This ensures Draft → Published directly.
Create 3-5 Knowledge Articles using ATF
- Use Record Insert steps on kb_knowledge.
- Set them to Draft state.
Execute the bulk operation
- If your instance has a Publish list action/UI action available, use Click a List UI Action ATF step.
- Select multiple records and invoke Publish.
Validate results
- Assert all selected articles moved to Published state (or expected workflow state).
My assessment
For an ATF named"KM Bulk Operations & Mass Publishing", I would first verify:
- Is there a custom UI Action called Publish, Mass Publish, or Bulk Operations on kb_knowledge?
- Is the requirement from a customization or a ServiceNow plugin?
- Which ServiceNow release are you on?
Warm Regards,
Shaik Mustaq.