Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Ui action in knowledge article

Vinya Jakkula
Tera Contributor

Hi Team, 

Can anyone help me

I have created custom ui action on knowledge table. But is getting knowledge record not found.iam trying to redirect to workspace.

  • function CopyKnowWorkspace() {
        var number = g_form.getValue('number');
        var instance = "https://" + parent.location.hostname; // Get the instance hostname
        var knowLink = instance + "/now/sow/kb_view/kb_knowledge/" + number; // Construct the URL

        if (number) {
            // Copy the link to clipboard
            copyToClipboard(knowLink);
            alert("Copied to clipboard: " + knowLink);
        } else {
            alert("Knowledge article number is not available. Unable to generate link.");
        }
    }
5 REPLIES 5

Gaurav Shirsat
Mega Sage

Hello @Vinya Jakkula 

below is Sample URL of Knowledge Article opened in an Workspace.

https://dev******.service-now.com/now/sow/kb_view/kb_knowledge/c85cd2519f77230088aebde8132e70c2

https://dev******.service-now.com/ : Instance URL

/now/sow : your Redirection to Workspace

kb_view/kb_knowledge : Knowledge Article View 

c85cd2519f77230088aebde8132e70c2 : sys_id of your article

 

GauravShirsat_0-1736002876384.png

 

you are redirecting to wring URL Dynamically.

 

Thanks and Regards

Gaurav Shirsat