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

Hi @kamal_s 

We got a small issue, actually this is working on my PDI, but it is not working now as expected in our domain separated instance..

can you please help..

 

Thanks,

Asish

Asish17
Tera Contributor

Hi @kamal_s 

we have analyzed that the instance version may be the issue because my PDI is in Tokyo version where as my company instance is in San diego version and as you suggested calling the function in the BR i.e. "KnowledgeUIAction()" this is extending from this "KnowledgeUIActionSNC" so when we compared both script includes of "KnowledgeUIActionSNC" we found 45 lines of code in san diego version where as in Tokyo version we had 88 lines with some publish methods in it so this is the reason we think the pushing publish button is working in tokyo version but not in san diego version... is there any way to work in san diego aswell..

Can you please help..

 

Thanks,

Asish

kamal_s
ServiceNow Employee
ServiceNow Employee

Hi @Asish17,

Open the UI Action - "Publish" from the knowledge page and confirm the code in the action. We have to use the same API being called from the UI to have the same effect.

This is a good find as you might have to update the code later when you upgrade your instance.

Asish17
Tera Contributor

Hi @kamal_s 

Thanks for the reply!!

In the Knowledge page UI action code is different when compared to tokyo version...

Asish17_0-1672837306432.png

This is the code for present UI Action - publish, can you please help us what is the API being called from UI to have the same effect because our instance is not moving to Tokyo version for now...

 

 

Thanks,

Asish