'Publish' UI action not working in kb_knowledge form seems like a major bug in ServiceNow platform
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2019 11:28 PM
Hi,
We have OOB UI action 'Publish' for ServiceNow platform on kb_knowledge table . When we want to publish an article then if we click on publish it publishes the KB article .
Have requirement like we need to Publish the article to users who are subscribed to the related service offering(s) or to all users when the article is marked public . Hence i created a new UI action 'Publish' on kb_knowledge table as shown below
Now when clicking on Publish button , it's not working it's doing the submit action (reverting to the previous form) but not publishing the article.
Suspecting that it might be because of creating this new UI Action inactivated the newly created UI action but in the kb_knowledge form cannot see the OOB Publish button which is supposed to be there (thinking that when the new KB button is created system is pointing to this new button hence not showing).
So activated back the UI button then could see the publish button (what i thought is correct it's pointing to the new one) .
Now no KB Article is getting published (it's not working it's doing the submit action (reverting to the previous form) but not publishing the article . it's severely impacting our instance
Can any one please reply what is the cause of this weird behavior
is this a bug in ServiceNow or a mistake done by me while creating the UI action. If it's a mistake from my end then the moment I inactived the newly created UI action it should work right. ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2019 12:46 AM
Hi
I'm sure i remember that there was an issue after the upgrade with the condition on the ui action. Try amending/removing and see if it will work for you.
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2019 02:23 AM
Hi Dave,
The ServiceNow version we are using is Kingston & i even deleted the UI action created by me & tried (as the issue occurred when i created this UI ation). I could not see the publish button (because the system is pointing since then it was created)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2019 02:57 AM
Hi,
I see that the UI Action which you create do not have much scripting compared to the oob ui action, But you added few more conditions.
Could you please try the same OOB script in the new UI Action and update the conditions according to the requirement.
The OOB script is mentioned below:
if(new KBKnowledge().canPublish(current)){
var prevValue = current.workflow_state + '';
if (current.kb_knowledge_base.kb_version == "3" && new KBWorkflow().startWorkflow(current, "workflow")) {
//If publish sub workflow is completed, workflow engine would have already done current.update()
if(current.workflow_state!='published')
current.update();
var knowledge = new GlideRecord("kb_knowledge");
if(knowledge.get(current.sys_id) && prevValue != knowledge.getValue("workflow_state")){
gs.addInfoMessage(new KBKnowledge().getStateMessage(knowledge.getValue("workflow_state")));
}
} else if (current.kb_knowledge_base.kb_version == "2") {
current.workflow_state = 'published';
current.update();
gs.addInfoMessage(new KBKnowledge().getStateMessage(current.getValue("workflow_state")));
}
}
If you you are able to achieve the requirement.
Kindly mark my answer as correct.
Or else please revert back with the detailed issue and the condition which you are trying to put. I will be happy to help.
Regards,
Alok
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2019 12:46 AM
Tried with the same lines of code you have provided but it's not working