Update "Publish" UI action on the kb_knowledge form to stay on the current page

tilmenastij
Giga Contributor

To update the "Publish" UI action on the kb_knowledge form to maintain the current pages as the redirect, . The "Publish" UI action can only be seen by Admin, KB Owner, and revisor by default. When a user clicks "Publish," it sets the article in a state to 'Review' and close the form and redirect to list view .

2 ACCEPTED SOLUTIONS

Robbie
Kilo Patron
Kilo Patron

Hi @tilmenastij,

 

Add the following line highlighted in bold to the final publish function as follows:

 

function publish() {
    new global.KnowledgeUIAction().publish(current);
    action.setRedirectURL(current);
}

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

View solution in original post

AJ-TechTrek
Giga Sage
Giga Sage

Hi @tilmenastij ,

 

You need to change the " Publish" UI action button from script as mentioned below, it help to resolve your issue.

 

action.setRedirectURL(current);

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.

 

Thanks

AJ

Linkedin Profile:- https://www.linkedin.com/in/ajay-kumar-66a91385/

ServiceNow Community Rising Star 2024

View solution in original post

2 REPLIES 2

Robbie
Kilo Patron
Kilo Patron

Hi @tilmenastij,

 

Add the following line highlighted in bold to the final publish function as follows:

 

function publish() {
    new global.KnowledgeUIAction().publish(current);
    action.setRedirectURL(current);
}

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

AJ-TechTrek
Giga Sage
Giga Sage

Hi @tilmenastij ,

 

You need to change the " Publish" UI action button from script as mentioned below, it help to resolve your issue.

 

action.setRedirectURL(current);

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.

 

Thanks

AJ

Linkedin Profile:- https://www.linkedin.com/in/ajay-kumar-66a91385/

ServiceNow Community Rising Star 2024