ESC: Approval task for knowledge database approvals does not show anything

Linda6
Mega Guru

The ESC does not show the "details" for a knowledge article approval, which is in this moment confusing.
At the moment there are obviously no details shown in the approval task.

Expected behavior:
- me as the user have an open Approval Task for a Knowledge Base Article, the Approval task (to publish KBA), is shown in My To-Do on Employee Center

I checked and the Publish workflow is always 'Knowledge - Approval Publish'.

But the task does not appear in My To-dos:

 

74backend.png74frontend.png

 

 

2 REPLIES 2

Susan Britt
Mega Sage
Mega Sage

This is the OOB behavior for knowledge articles, and agreed, it is confusing. 

 

When you look at article approvals comparted to all others, you will see that the link back to the article, title and detail rows do not appear (even though defined in the approval's To-do Configuration record).  This is because the artilce table doesn't extend the task table.  To resolve you can do the following:

  1. Clone the "Todos Approval" widget
  2. Update your new cloned widget (name something like "Todos Approval-KA")
    • Update HTML accordingly - can give you some examples below
    • Update the server script section to give link for KA
  3. Create new To-dos Configuration for non-knowledge approvals
    • Condition:  Source table IS NOT kb_knowledge AND Source table IS NOT kb_knowledge_block
    • To-dos widget mapping is the OOB "Todos Approval" widget
    • Be sure to capture all the scenarios for approvals and widgets in your OOB one, because depending on your release and active applications, you may have several
  4. Create new To-dos Configuration for knowledge approvals 
    • Condition:  Source table IS kb_knowledge OR Source table IS kb_knowledge_block
    • Title row: give it more meaning title (e.g., Approve Article)
    • Detail row: Add "approving" field
    • To-dos widget mapping is your cloned version of the Todos Approval widget
  5. Deactivate the OOB Approvals To-do

 

Examples:

SusanBritt_0-1674180299431.png

<!-- Customization for KA Links -->
   <!--div class="panel-body"  id="todo-approval-panel-heading" ng-class="approval-requested" >
              <h4 id="approval-message">{{ data.approvalText}} </h4-->
   <div class="panel-body" ng-class="approval-requested" >
    <a href="{{instance}}/kb_view.do?sysparm_article={{data.kbSysID}}" target="_blank"><b>Click here to view the article</b></a>
<!-- End Customization -->

*** I would recommend calling messages instead of hard-coding the message, but these are quick examples ***

 

SusanBritt_1-1674180424074.png

<!-- Customization for KA Links -->
   <!--div class="panel-body"  id="todo-approval-panel-heading" ng-class="approval-requested" >
              <h4 id="approval-message">{{ data.approvalText}} </h4-->
   <div class="panel-body" ng-class="approval-requested" >
     <h4 id="approval-message">
    <a href="{{instance}}/kb_view.do?sysparm_article={{data.kbSysID}}" target="_blank">{{ data.approvalText}}</a></h4>
<!-- End Customization -->

 

Server script:

at top of function when setting variables

    /* Customization for KA Link */
    data.kbSysID = '';
    data.buttonMsg = gs.getMessage(options.button_text || "click here");
    /* End Customization */

 

  ...          if (!gs.nil(sysApprovalRecord.sysapproval.short_description))
                data.shortDescription = sysApprovalRecord.sysapproval.short_description;
            else if (!gs.nil(sysApprovalRecord.document_id))
                data.shortDescription = !gs.nil(sysApprovalRecord.document_id.short_description) ? (sysApprovalRecord.document_id.number + " - " + sysApprovalRecord.document_id.short_description) : sysApprovalRecord.document_id.number;
            else
                data.shortDescription = sysApprovalRecord.sysapproval.number;
            data.approvalText = gs.getMessage("Do you want to approve the following: {0}?", data.shortDescription);
			
	/* Customization for KA Link */
	data.kbSysID = sysApprovalRecord.document_id.number.toString();
	var instance = gs.getProperty('glide.servlet.uri') + '';
	/* End Customization */
			
        } else
            gs.addErrorMessage(gs.getMessage("Unexpected action occurred"));
        return sysApprovalRecord;
    }

    //Function to update the state of the approval

 

 

Alex87
Tera Contributor

Thank you for sharing Susan. How did you manage to activate the comment section & approval buttons. When i follow your code, i dont see the below area:

Alex87_0-1693396512730.png