Business Rule to auto publish knowledge article from closed incident

E-E
Tera Contributor

Hi,
I am trying to create a knowledge article when closing an incident that automatically gets published. I've edited the Incident Create Knowledge Business Rule as attached, calling the script include and trying to change the status to Published instead of Draft.

However when closing an incident, the article is still saved as Draft.
The workflow of the knowledge base used was the OOTB Knowledge Instant Publish.
Any ideas on why it is not working?

Thank you in advance.
BR .png

2 REPLIES 2

Danish Bhairag2
Tera Sage
Tera Sage

Hi @E-E ,

 

On 17th line 'KbSysId' I cannot see were it is defined, maybe that might be causing the issue. Also on 18th Line u can just pass the above variables kbSysId instead of kb.

 

Replace 17th & 18th line with below 2 lines please.

var kbSysId = kb.Insert();
global.KnowledgeUIAction().publish(kbSysId);

 

Please mark my answer helpful & accepted if it helps you resolve your query.

 

Thanks,

Danish

AnveshKumar M
Tera Sage
Tera Sage

Hi @E-E ,

 

Make some changes to the script like, on line number 17 add var  keyword at the start of the line, and in line 18 add new keyword at the start and change the input Glide Object as shown in the code below. And also you need to add the following lines between line 17 & 18 as shown below.

 

 

var kbsys_id = kb.insert(); // Line number 17

var kbGr2 = new GlideRecord('kb_knowledge');
kbGr2.get(kbsys_id);

new KnowledgeUIAction().publish(kbGr2); // Line number 18

 

 

Please mark my answer helpful and accept as solution if it helped you 👍✔️

Thanks,
Anvesh