Knowledge approval in portal

x_14
Kilo Contributor

From the service portal, under the My Approvals section, if the item to be approved is a Knowledge Article, a link is provided that when clicked displays some detail about the article to be approved, including the KB# and the Short Description. How would I add the body of the article itself? I thought it would be controlled by the widget, but this is only affecting the initial listing, not what's shown when the user clicks the link.

Appreciate any insight!

4 REPLIES 4

Mark C_
Tera Expert

I have the same question too. Not sure if this has been sorted out already.

SHWA
Tera Contributor

Hello,

I recently encountered the same issue and made some customizations.

One of the easiest ways I think is to add a widget to "Approval Form" page. To do this, you can create a clone of "KB Article Page" widget and make a few modifications to the beginning of the Server Script.

 

For example, you can include the following script:

var approvalid = $sp.getParameter("sys_id");
var approvalGR = new GlideRecord("sysapproval_approver");
approvalGR.get(approvalid);
var id = approvalGR.document_id;

 

Additionally, remove or comment out the line "var id = $sp.getParameter("sys_id") || $sp.getParameter("sys_kb_id");"

I hope this helps you.

Peter Schmitt1
Tera Contributor

This was a quite helpful Solution, thanks Shingo!. As it provided an error in our Service Portal because the id could be 'null' on line 11 in the script, we changed the script to the following

(function() {
    var approvalid = $sp.getParameter("sys_id");
    var approvalGR = new GlideRecord("sysapproval_approver");

    if (!approvalGR.get(approvalid)) {
        return; // Exit if no matching sysapproval_approver record
    }

    var id = approvalGR.document_id;

    if (!id) {
        return; // Exit if document ID is null
    }

before 

var t = data;

 also we removed this part in the HTML Body to hide the message while approvals will be opened for non-KB Articles...

 

<div ng-if="!data.isvalid">
${Article not found}
</div>

 

 

Anusha Nalluri
Giga Contributor

@Peter Schmitt1 , did you find solution for this