Show the "Requests" header menu item link in Service Portal homepage for all tickets even closed or with zero request


Out-of-the-box in early Jakarta, for any user, the "Requests" menu item link on the top right corner of the Service Portal homepage shows only if there are active tickets raised by the logged-in user. This is a scripted menu item, and is not designed OOB to show in case of no requests present.


Steps to Reproduce


  1. Navigate to Angular ng-template "memuTemplate" of the "Header Menu" widget:


    2. Remove ".count > 0" after "item.scriptedItems" (line 12 and 17):

    <a role="button" ng-if="item.scriptedItems.count > 0" href="javascript:void(0)" data-toggle="dropdown" title="{{item.hint}}">
    <fa ng-if="item.glyph" name="{{::item.glyph}}"></fa>

    <sp-dropdown-tree role="menu" aria-label="{{::item.label}}" ng-if="item.scriptedItems.count > 0" items="item.scriptedItems.items" />

    The workaround provided in the SN community for Jakarta Patch 1 was the following:

    3. Navigate to Service Portal home page. Notice that Requests are not still showing:


Please see article KB0688949 to verify if your instance is upgraded to one of the versions containing the new SP code. The display of the "Requests" link is controlled by the widget Header Menu. In early Jakarta the workaround below was used in case users were ok to display closed tickets in the dropdown "Requests". The Header Menu widget also would need to be cloned along with its dependencies, and modified accordingly in all its calls.

- Navigate to Service Portal > Portals > Open "sp" (ID) record.

- Open the referenced record in Main Menu field which is SP Header Menu.

- Under Menu Items related list, open Requests (label) record.

- The Server Script field handles the display of active requests in the dropdown when "Requests" is clicked.

- In the script, there are three statements containing addActiveQuery(). This is a method in the GlideRecord object that queries only "active" records.

- Comment those statements and save your updates, you will notice the Requests link shows up in the portal homepage and when you click it, you will see the dropdown showing all tickets (including closed ones).


Related Problem: PRB1244279