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

jaheerhattiwale
Mega Sage
Mega Sage

@Asish17 Add below code to record producer script

 

current.workflow_state = "review";

 

jaheerhattiwale_0-1672391675646.png

 

Please mark as correct answer if this solves your issue.

 

 

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

Hi @jaheerhattiwale 

Thanks for the reply!!!

Yes I followed the same but its not going to review whenever I submitted the RP..

Asish17_0-1672400238173.png

Asish17_1-1672400290779.png

 

 

Thanks,

Asish

 

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.

Asish17
Tera Contributor

Hi @kamal_s 

Thanks for the reply!!!

If you had time can you please explain it clear...

what we have done is we have created new knowledge base and a record producer and mapped to new knowledge article form fields, so the data will be redirected to knowledge article page and we have modified the OOB Approval publish workflow according to our requirements and called in our newly created KB so whenever a article is raised its going to draft state after its get publish its going for review so our requirement is to have control on this so it can be automatically goes to approvers without publishing.... so whenever a article is submitted it should goes to approvers which we have given in our workflow with stage Review..

can you please help..

 

Thanks,

Asish