Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Want to show KB article in pending retirement state on portal

Drishti
Tera Guru

Hi Community,

How can we show KB article in pending retirement state on portal ?

Please guide.
I already had tried making change in the Search Source used in my portal , but no luck.

Thanks in advance.

2 REPLIES 2

Chetna_dev
Kilo Sage

To display Knowledge Base (KB) articles in a "Pending Retirement" state on the ServiceNow portal, follow these steps:

Step 1: Verify KB Article State

  1. Check the Article: Ensure the articles are in the "Pending Retirement" state.

Step 2: Modify Search Source

  1. Access Service Portal: Navigate to Service Portal > Portals and open your portal.

  2. Edit Search Source: Go to Service Portal > Search Sources and modify the relevant source. Ensure the script  var gr = new GlideRecord('kb_knowledge');
    gr.addQuery('state', 'pending_retirement');
    gr.query();

     

    Step 3: Customize the Widget

    1. Find the Widget: Go to Service Portal > Widgets and locate the one displaying KB articles.

    2. Edit Widget Code: Adjust the server script to include "Pending Retirement" articles:

    Step 4: Clear Cache

    • Clear the cache via System Maintenance > Cache > Clear Cache.

    Step 5: Test

    • Visit your Service Portal to confirm that the articles appear.

if you found this helpful please accept as solution and mark helpful

best

Chetna

 

Hi @Chetna_dev  ,

Thanks for your response.

Will you please guide, where exactly in the server script of widget we have to modify code?

Please.