How to automate a knowledge article to review state to publish after inserting

Asish17
Tera Contributor

Hi Team,

 

I am creating a knowledge article record producer

Please let me know that how to set a knowledge article state to review instead of draft stage as soon as its gets created. witch means with stage as review and it should ask for publish workflow approvals by default.

(means knowledge article creation itself asking for publishing)

please help..

 

 

Thanks,

Asish

1 ACCEPTED SOLUTION

kamal_s
ServiceNow Employee
ServiceNow Employee

Hi @Asish17

It does seem simple but its not since the version control on Knowledge Management is put to move articles in the draft state only on creation.

So there are few approaches you can take in this case.

1st approach (preferred)

1. Submit the knowledge article mentioning the created by as a unique service account

2. Create a BR/Flow (async) on Knowledge to take these knowledge article from draft state and created by the unique account and use the OOTB "global.KnowledgeUIAction().publish(current)" function to publish it.

 

Another approach (less preferred)

1. modify the BR which is stopping the articles to be created in other states then draft but restrict it to the unique service account only.

2. push the articles in review state and trigger the publish flow.

View solution in original post

13 REPLIES 13

Asish17
Tera Contributor

Created a BR as you suggested with some small modifications..

Asish17_1-1672584828543.png

Asish17_2-1672584844407.png

 

Thanks,

Asish

kamal_s
ServiceNow Employee
ServiceNow Employee

Hi @Asish17,

Since your knowledge base is unique, the above condition would also work and you won't need a Service Account assuming all article creation is happening from the record producer.

 

The line of code in the BR pushes the article for review/publish hence your modified approval workflow which you would have attached to the knowledge base should take it from here.

Asish17
Tera Contributor

Hi @kamal_s 

Thanks for the reply!!

yes knowledge base should take it from there but its not happening...

Asish17_0-1672637209196.png

again it is in Draft stage after publish its going for approvals... but our requirement is upon submit it should go to approvals instead of we clicking the publish button...

please help..

 

Thanks,

Asish

kamal_s
ServiceNow Employee
ServiceNow Employee

Hi @Asish17

Your BR is missing the 'new' keyword that's why its not taking effect.

please use this exact line:  new global.KnowledgeUIAction().publish(current);

Asish17
Tera Contributor

Hi @kamal_s 

It is working as expected, Thankyou somuch 🙂

 

Thanks,

Asish