The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Issue with Contextual Search for Record Producer in Service Portal

Shahed Shah1
Tera Guru

Hi community,

I have experienced a very strange issue with the contextual search in the portal and am not clear if there is a missing configuration or something I'm just doing plain wrong.

 

The scenario

I have created an Incident Record Producer (not modified the OOB 'Create Incident' one). Then I followed the steps outlined in the docs (Define contextual search for record producer), so:

  1. Setting the 'Record producer' field to my custom one
  2. Search Context = Incident Deflection
  3. Variable = Comments (from the Record Producer)

A new variable 'Contextual Search Results' is added to the Record Producer. You have to go into the newly created variable and set the Widget to 'Contextual Search - Inline Results', otherwise it will not work on the portal.

Then I navigate to the record producer in the portal and type a search string into the respective search variable.

 

Expected results

See how the Order button is rendered in the screenshot below from the OOB Create Incident Record Producer for Catalogue Items in the portal

find_real_file.png

 

Actual results

This is what I really get in the portal

find_real_file.png

It should also be noted that the 'This is helpful' button does not get rendered for Knowledge Articles in the results. An additional note is that the functionality works in the Desktop UI (navigate to the Service Catalogue in UI16) but not in the portal.

 

Workaround

After comparing the Search Action Configuration between 'Create Incident' and my IRP, an immediate difference is the value of the 'Show on new record' - 'true' for OOB and 'false' for my config. In order to update that I needed to play with ACLs as the 'cxs_ui_action_config' table is locked down to maint only and run a script to update it:

var gr = new GlideRecord('cxs_ui_action_config');
gr.addEncodedQuery('search_ui_config=xxxxx'); // respective sys_id comes here
gr.setValue('show_on_new', true);
gr.updateMultiple();

Thankfully this is captured in an Update Set so that I can restore the ACL.

WARNING: For anyone getting ideas for this, please be verrry careful with 'maint' related ACLs. They are there for a good reason, so please do not touch them if you don't know what you're doing. I only did this as part of my troubleshooting.

 

Additional notes

The customer's instance is on Rome Patch 4 Hotfix 1a, but I was able to reproduce this in my Rome Patch 5 PDI and in a colleague's PDI running the San Diego release.

 

The Question

So. My question is: Have I completely gone off the rails and set this up completely wrong or is this a genuine issue?

Thank you for your time

 

EDIT #1: Added warning and corrected some typos

EDIT #2: After digging around the Support KB I managed to identify KB0714564, which details that the Contextual Search widget needs to be added manually to the variable for it to work in the portal, as I have done above. It does feel like a workaround than a solution when the Macro is set on creation.

EDIT #3: Found another Support KB (KB0752986), which shows a similar symptom where the actions are not rendered at all due to the configuration missing. However, it may be an article for SN Support as Admins do not have permissions to write to the Search Action Configurations [cxs_ui_action_config] table (as demonstrated above).

EDIT #4: Good news. I have done subsequent tests on San Diego and Tokyo instances and was able to run the workaround script without having to disable the 'maint' ACL.

1 ACCEPTED SOLUTION

Hi Sandhya

This was reproduced on a PDI on Quebec through to San Diego. However, I am concerned with advising this workaround which modifies a 'maint' specific ACL.

So, I'll try to get a Case opened with Support to get this Problem and an official workaround (there might be a better one), while I try to sort out my access to report issues on behalf of this customer.

Cheers

View solution in original post

2 REPLIES 2

Sandhya Bellann
ServiceNow Employee
ServiceNow Employee

This is a valid issue and your workaround is correct to resolve the issue.

However, if you are able to reproduce it OOTB I would recommend to raise a case with steps to reproduce the issue in PDI so that engineer can raise a PRB.

Hi Sandhya

This was reproduced on a PDI on Quebec through to San Diego. However, I am concerned with advising this workaround which modifies a 'maint' specific ACL.

So, I'll try to get a Case opened with Support to get this Problem and an official workaround (there might be a better one), while I try to sort out my access to report issues on behalf of this customer.

Cheers