How to auto publish knowledge article created from incident when incident is closed.

E-E
Tera Contributor

Hi, 
When creating a knowledge article from incident, the article will be saved as Draft when the incident is closed, and in order to publish we need to go to the article record and press publish.

Instead, I am looking for a way to directly publish the article when the incident is closed. (skipping Draft, Review stage. )
Do I have to create a new Knowledge Base and create a new flow or is there some other way to do this? 
Would appreciate it if you could provide the steps for this as I do not have much experience on those functions.
Thanks.

7 REPLIES 7

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @E-E 

 

Greetings!!

 

1 point, it is not recommended approach to publish the article immediate as there are chance that you need to update the Meta data and other information in KB which is not coming from Incident and you need to manually entered and there are case that in KB few more information need to updated / formatted to make it presentable , so my suggestion do it manually.

 

But still you want to do , yes create New Base and flow and that flow must be go from draft to publish.

 

Also still curious to know, what is the business case for this?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @Dr Atul G- LNG 
Thanks for your reply. 
Our client wants to make sure all closed incidents are stored as knowledge so wants to automate the process. 
Could you provide me a bit more information on how to create the workflow that goes Draft to Published? I'm new to workflow and struggling to get it right.
Thank you. 

Hi @E-E 

 

Please have a look . You can also do with help of Business Rule as well. 

 

https://youtu.be/F6w0jRLyBuw

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************
csa #ServiceNow #TechnoFuncational Disclaimer: These videos are from my training batch. These videos did not promote any ServiceNow Sales pitch or marketing. These videos are only for knowledge purposes & basic on my experience & Knowledge. Redistribution or copying of functionality is not ...

Sandeep Rajput
Tera Patron
Tera Patron

@E-E Please create a business rule on incident table with following configuration.

 

Screenshot 2023-09-29 at 4.35.53 PM.png

Screenshot 2023-09-29 at 4.36.45 PM.png

Here is the script 

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var relatedKBArticle = new GlideRecord('m2m_kb_task');
	relatedKBArticle.addQuery('task',current.getValue('sys_id'));
	relatedKBArticle.query();
	if(relatedKBArticle.next()){
		global.KnowledgeUIAction().publish(relatedKBArticle.kb_knowledge);
	}

})(current, previous);

Hope this helps.