Show Related Incidents Icon - Edit Default Filter

dsnyder
Kilo Explorer

I know I can set up a "Default Filter" for Related Incidents tabs at the bottom of my incident views. However, I would like to set up the same default filter for the Show Related Incidents icon. When I try to add the "Edit Default Filter" from the slush bucket and save, it appears for a second and then disappears from the form. I've looked for Client Scripts, Business Rules and other areas that might be causing this behavior but am unable to determine the cause. I would greatly appreciate any help on this issue. Thank you.

1 ACCEPTED SOLUTION

cwhaley
Kilo Expert

I'm assuming that you are referring to the Show Related Incidents icon that shows up next to the Caller field (when populated) on Incident tickets. If so, then you simply need to modify the query in the UI Macro.

Here's the procedure:
1. Navigate to the UI Macros module under the System UI application.
2. Search for the UI Macro named "user_show_incidents" and open it.
3. Scroll to the bottom of the XML field and look for the line that looks like this:
url += 'sysparm_query=' + referenceField + '=' + v;
4. Modify the query by adding your encoded query structured filter to it.
5. For example, if you only wanted "ACTIVE" incidents to show, then you'd update the line to look like this:
url += 'sysparm_query=' + referenceField + '=' + v + "^active=true";
6. Now save your change and try it out.

Hope this helps!


View solution in original post

4 REPLIES 4

dsnyder
Kilo Explorer

I found that this field was being hidden by a UI Policy. I changed this policy to make the field visible but then when I try to update the filter, I get an error message that says I need to define the table. The table is already defined as "incident" on the form. Does anyone have any ideas or suggestions? Or has anyone out there applied this default filter to the Show Related Incidents icon?


cwhaley
Kilo Expert

I'm assuming that you are referring to the Show Related Incidents icon that shows up next to the Caller field (when populated) on Incident tickets. If so, then you simply need to modify the query in the UI Macro.

Here's the procedure:
1. Navigate to the UI Macros module under the System UI application.
2. Search for the UI Macro named "user_show_incidents" and open it.
3. Scroll to the bottom of the XML field and look for the line that looks like this:
url += 'sysparm_query=' + referenceField + '=' + v;
4. Modify the query by adding your encoded query structured filter to it.
5. For example, if you only wanted "ACTIVE" incidents to show, then you'd update the line to look like this:
url += 'sysparm_query=' + referenceField + '=' + v + "^active=true";
6. Now save your change and try it out.

Hope this helps!


How would you do this but for all records? I am trying to achieve this and recreate another UI Macro button that actually shows all the record the user is a caller/requester. Thanks!


dsnyder
Kilo Explorer

This worked perfectly. Thank you!