HR cases in portal search results

si21
Tera Guru

Hi experts,

we have created AI search source to display HR Case on the portal search results.

We also configured AI search result action to navigate to our ticket page but still cases are opening in Native UI.

How can we fix this issue.

 

TIA

1 REPLY 1

pratikjagtap
Giga Guru

Hi @si21 ,

 

follow below steps:

 

1. Navigate to:
AI Search > Search Result Actions

  • Find your HR Case Action and verify:

    • Action Type: Open URL

    • URL: It should direct to the Service Portal case page.
      Example: /sp?id=ticket_page&table=sn_hr_core_case&sys_id=${sys_id}

  • Ensure sys_id is dynamically replaced with the actual case ID.

Verify the AI Search Source

  1. Go to:
    AI Search > Search Sources

  2. Find your HR Case Source and confirm:

    • Table: sn_hr_core_case

    • Result Action: The action should be assigned correctly.

3.Override Default Navigation Using an AI Search Script

If the issue persists, override the default navigation behavior via a Client Script:

  1. Go to: System UI > Scripts - Background (for testing)

  2. Run this test script:

function overrideCaseNavigation() {
var gr = new GlideRecord('sys_search_action');
gr.addQuery('table', 'sn_hr_core_case');
gr.query();

while (gr.next()) {
gr.url = '/sp?id=ticket_page&table=sn_hr_core_case&sys_id=${sys_id}';
gr.update();
}
}
overrideCaseNavigation();

 

If this solution helps you then, mark it as accepted solution ‌‌✔️ and give thumbs up 👍 !

 

Regards,

Pratik