<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>post Customizing the Optimize GRC Issue Resolution Use Case in GRC articles</title>
    <link>https://www.servicenow.com/community/grc-articles/customizing-the-optimize-grc-issue-resolution-use-case/ta-p/3521376</link>
    <description>&lt;H3 style="font-size: 18px; color: #0070d2; margin-top: 32px;"&gt;Overview&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Optimize GRC Issue Resolution use case works out of the box, but every organization has different data volumes, resolution patterns, and process expectations. This article covers every supported customization — from tuning which past issues are used as reference data, to adjusting how the action plan and remediation tasks are generated, and modifying agent behavior and messaging.&lt;/P&gt;
&lt;P&gt;The two agents and their skills are accessed from:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;&lt;SPAN&gt;Usecase: All → Now Assist AI Agents → AI Use Cases&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Agents: All → Now Assist AI Agents → AI Agents&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Skills: All → Now Assist Skill Kit → Skill&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Indexed Sources: All → Indexed Sources&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION: QUICK REFERENCE ===================== --&gt;
&lt;H3 style="font-size: 18px; color: #0070d2; margin-top: 32px;"&gt;Quick Reference&lt;/H3&gt;
&lt;TABLE style="width: 100%; border-collapse: collapse; margin: 16px 0;"&gt;
&lt;THEAD&gt;
&lt;TR style="background: #f0f7ff;"&gt;
&lt;TH style="width: 40%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;What you want to change&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 60%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;How&lt;/P&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY style="font-weight: normal;"&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-1" target="_self"&gt;Which resolved issues are used as reference data&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit the &lt;STRONG&gt;Issue closed&lt;/STRONG&gt; filter condition in the &lt;STRONG&gt;GRC issues&lt;/STRONG&gt; indexed source&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-2" target="_self"&gt;How similar a past issue must be to be included&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit &lt;CODE&gt;SCORE_THRESHOLD&lt;/CODE&gt; in the &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool of the &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; skill&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-3" target="_self"&gt;How many past issues are retrieved for comparison&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit &lt;CODE&gt;MATCH_COUNT&lt;/CODE&gt; in the &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool of the &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; skill&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-4" target="_self"&gt;Agent messages, flow behavior, and display format&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit instructions on the &lt;STRONG&gt;Issue Action Plan AI Agent&lt;/STRONG&gt; and &lt;STRONG&gt;Remediation Tasks AI Agent&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-5" target="_self"&gt;What context is used to find similar historical issues&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Enrich the search query in the &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool of the &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; skill&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-6" target="_self"&gt;How to apply additional filters while performing RAG search on closed issues&lt;/A&gt;&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Add dynamic filter conditions in the&amp;nbsp;&lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool of the &lt;STRONG&gt;Issue Action Plan Generation skill&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION 1 ===================== --&gt;
&lt;DIV id="section-1" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;1. Adjusting Which Issues Are Used as Reference Data&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;The action plan generation only draws from issues that are closed. By default, this means issues in &lt;STRONG&gt;Closed Complete&lt;/STRONG&gt; or &lt;STRONG&gt;Closed Incomplete&lt;/STRONG&gt; state. You can change this filter to expand or narrow the pool of reference issues.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Navigate to&lt;/P&gt;
&lt;P&gt;All → Indexed Sources → search for &lt;STRONG&gt;GRC issues&lt;/STRONG&gt; → open → find the &lt;STRONG&gt;Issue closed&lt;/STRONG&gt; filter condition → edit.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Current filter&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;state = 3 (Closed Complete) OR state = 4 (Closed Incomplete)&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;What you can safely change&lt;/P&gt;
&lt;P&gt;- Add additional closed states if your organization uses custom issue states&lt;/P&gt;
&lt;P&gt;- Add further conditions to narrow the pool — for example, restrict to issues from a specific category or assigned group&lt;/P&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;Tradeoff: A broader filter increases the pool of reference issues and can improve plan quality — but only if those issues have meaningful action plans and remediation tasks. Issues without action plans or linked tasks are automatically excluded at runtime even if they pass the filter, so adding more states with poor data quality will not help. A narrower filter may leave too few relevant matches for sparse datasets.&lt;/DIV&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION 2 ===================== --&gt;
&lt;DIV id="section-2" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;2. Adjusting the Similarity Threshold&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;The similarity threshold controls how closely a past issue must match the current one before it is included in the comparison set. The default is &lt;STRONG&gt;80%&lt;/STRONG&gt;. A past issue that scores below this threshold is excluded regardless of how many results are available.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Navigate to&lt;/P&gt;
&lt;P&gt;All → Now Assist Skill Kit → Skill → search for &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; → open → Tools → open &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool → edit the script.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example snippet&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var SCORE_THRESHOLD = 0.80;  // default — lower to include more results, raise for stricter matching&lt;/PRE&gt;
&lt;TABLE style="width: 100%; border-collapse: collapse; margin: 16px 0;"&gt;
&lt;THEAD&gt;
&lt;TR style="background: #f0f7ff;"&gt;
&lt;TH style="width: 20%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Value&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 80%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Effect&lt;/P&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY style="font-weight: normal;"&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;0.70&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;More past issues included — useful when data is sparse but may introduce loosely related patterns&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;0.80 (default)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Balanced for most environments&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;0.90&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Only very closely matched issues included — higher precision but may return nothing on new issue types&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Tradeoff:&lt;/STRONG&gt; Lowering the threshold increases the number of reference issues but risks introducing irrelevant patterns into the generated plan. Raising it improves precision but may result in no plan being generated if your historical data is limited. Test against real issues in your instance before deploying.&lt;/DIV&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION 3 ===================== --&gt;
&lt;DIV id="section-3" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;3. Adjusting the Number of Past Issues Retrieved&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;By default, up to &lt;STRONG&gt;20 past issues&lt;/STRONG&gt; are retrieved and passed to the AI model for synthesis. All retrieved issues must also meet the similarity threshold — so the actual number sent to the model may be lower.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Navigate to&lt;/P&gt;
&lt;P&gt;All → Now Assist Skill Kit → Skill → search for &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; → open → Tools → open &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool → edit the script.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example snippet&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var MATCH_COUNT = 20;  // default — increase for richer synthesis, decrease to reduce latency&lt;/PRE&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Tradeoff:&lt;/STRONG&gt; A higher count gives the AI model more patterns to synthesize from, which can improve plan quality when your historical data is rich and varied. However, each retrieved issue includes its full action plan and all linked remediation tasks — a higher count increases the size of the prompt sent to the model and can slow response time. Keep the value within a reasonable range for your data volume.&lt;/DIV&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION 4 ===================== --&gt;
&lt;DIV id="section-4" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;4. Editing Agent Instructions&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;Each agent has its own instruction set that controls its conversational behavior — the messages it displays, how it presents options to the user, and how it handles each user choice. These are separate from the skill prompts and can be updated independently.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Issue Action Plan AI Agent&lt;/P&gt;
&lt;P&gt;Navigate to:&lt;BR /&gt;All → Now Assist AI Agents → AI Agents → search for &lt;STRONG&gt;Issue action plan AI agent&lt;/STRONG&gt; → open → edit the &lt;STRONG&gt;Instructions&lt;/STRONG&gt; field.&lt;/P&gt;
&lt;TABLE style="width: 100%; border-collapse: collapse; margin: 16px 0;"&gt;
&lt;THEAD&gt;
&lt;TR style="background: #f0f7ff;"&gt;
&lt;TH style="width: 30%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Part&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 70%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;What you can change&lt;/P&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY style="font-weight: normal;"&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Accept / Edit / Dismiss prompt&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;The wording of the options presented to the user after the action plan is shown&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Acceptance message&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;What the agent says when the user accepts — including the note about the plan being saved to the issue record&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Dismissal message&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;What the agent says when the user dismisses — currently tells the user to populate the plan manually&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit refinement behavior&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;How the agent asks for and incorporates feedback when the user chooses to edit&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Error messages&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;What the agent says when the issue record cannot be found or the plan cannot be generated&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Remediation Tasks AI Agent&lt;/P&gt;
&lt;P&gt;Navigate to:&lt;BR /&gt;All → Now Assist AI Agents → AI Agents → search for &lt;STRONG&gt;Remediation tasks AI agent&lt;/STRONG&gt; → open → edit the &lt;STRONG&gt;Instructions&lt;/STRONG&gt; field.&lt;/P&gt;
&lt;TABLE style="width: 100%; border-collapse: collapse; margin: 16px 0;" width="100%"&gt;
&lt;THEAD&gt;
&lt;TR style="background: #f0f7ff;"&gt;
&lt;TH style="width: 30%; padding: 10px; text-align: left; border: 1px solid #ddd;" width="30%"&gt;
&lt;P&gt;Part&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 70%; padding: 10px; text-align: left; border: 1px solid #ddd;" width="70%"&gt;
&lt;P&gt;What you can change&lt;/P&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY style="font-weight: normal;"&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD width="30%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Accept / Edit / Dismiss prompt&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="70%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;The wording of the options presented after task suggestions are shown&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="30%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Task display format&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="70%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;How suggested tasks are displayed when the user edits — currently uses a Name / Description format&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD width="30%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Acceptance message&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="70%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;The confirmation message after tasks are created — currently tells the user to assign owners manually&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="30%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Dismissal message&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="70%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;What the agent says when the user dismisses — currently tells the user to create tasks manually from the issue page&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Tradeoff:&lt;/STRONG&gt; The LLM is sensitive to instruction wording. Changes to how options are presented or how feedback is collected can affect agent behavior in non-obvious ways. Always test with a range of real issue scenarios before saving changes to production.&lt;/DIV&gt;
&lt;!-- ===================== SECTION 5 ===================== --&gt;
&lt;DIV id="section-5" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;5. Enriching the Search Query with Additional Issue Details&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;The search query is what drives semantic matching against historical issues. By default, the &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool searches using the current issue's &lt;CODE&gt;short_description&lt;/CODE&gt; — and optionally includes &lt;CODE&gt;description&lt;/CODE&gt; when the &lt;CODE&gt;use_description&lt;/CODE&gt; input is enabled. Adding more context from the issue record — such as entity name, issue type, or custom fields — can improve the relevance of the historical matches returned.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Navigate to&lt;/P&gt;
&lt;P&gt;All → Now Assist Skill Kit → Skill → search for &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; → open → Tools → open &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool → edit the script.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Current code — how the search query is built&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var shortDescription = '';
var issueId = '';
if (issueGR.next()) {
    shortDescription = issueGR.getValue("short_description");
    if (inputs.use_description === 'true') {
        shortDescription += "\n" + issueGR.getValue("description");
    }
    issueId = issueGR.getValue("sys_id");
}
var references = getReferences(issueId, shortDescription,
    ['short_description', 'description'], ['body']);&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Modified code — enrich the query with entity and issue type&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var shortDescription = '';
var issueId = '';
if (issueGR.next()) {
    shortDescription = issueGR.getValue("short_description");
    if (inputs.use_description === 'true') {
        shortDescription += "\n" + issueGR.getValue("description");
    }

    // Enrich the search query with additional issue context
    var entityName = issueGR.getDisplayValue("profile");
    var issueTypeLabel = issueGR.getDisplayValue("issue_type");
    if (entityName) {
        shortDescription += "\nEntity: " + entityName;
    }
    if (issueTypeLabel) {
        shortDescription += "\nIssue Type: " + issueTypeLabel;
    }

    issueId = issueGR.getValue("sys_id");
}
var references = getReferences(issueId, shortDescription,
    ['short_description', 'description'], ['body']);&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;What you can safely change&lt;/P&gt;
&lt;P&gt;- Add any field from the &lt;CODE&gt;sn_grc_issue&lt;/CODE&gt; record to the query string — use &lt;CODE&gt;getDisplayValue()&lt;/CODE&gt; for reference fields to include the display name rather than the sys_id&lt;/P&gt;
&lt;P&gt;- Include custom fields your organization has added to the issue table&lt;/P&gt;
&lt;P&gt;- Adjust or remove the &lt;CODE&gt;\n&lt;/CODE&gt; separator — the semantic search treats the entire string as context, so the separator style has minimal impact&lt;/P&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Tradeoff:&lt;/STRONG&gt; Adding relevant context (like entity name or issue type) helps the semantic search find more precisely related historical issues. However, adding too many fields or irrelevant data can dilute the query and reduce match quality. Start with one or two additional fields and test against real issues to measure improvement.&lt;/DIV&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION 6 ===================== --&gt;
&lt;DIV id="section-6" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;6. Adding Dynamic Filters to RAG Search&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;By default, the RAG search returns all closed issues that match the search profile's static filter (&lt;CODE&gt;state=3^ORstate=4&lt;/CODE&gt;). If your organization needs to narrow results further at runtime — for example, to only compare against issues of the same type or issues related to a specific entity — you can add dynamic filter conditions using the &lt;CODE&gt;.condition()&lt;/CODE&gt; method on the &lt;CODE&gt;RAGRetrievalSource&lt;/CODE&gt;.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Navigate to&lt;/P&gt;
&lt;P&gt;All → Now Assist Skill Kit → Skill → search for &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; → open → Tools → open &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool → edit the script.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Current code — source construction without dynamic filters&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;request.sources([
    new sn_search.RAGRetrievalSource()
        .sourceTableName('sn_grc_issue')
        .fields(FIELDS)
        .filter(true)
]);&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example — filter by the current issue's type&lt;/P&gt;
&lt;P&gt;This restricts results to historical issues that share the same issue type as the current issue. You will need to pass the issue type value into the &lt;CODE&gt;getReferences&lt;/CODE&gt; function.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Step 1:&lt;/STRONG&gt; Extract the issue type and pass it to &lt;CODE&gt;getReferences&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;// After querying issueGR, extract the issue type
var issueType = issueGR.getValue("issue_type");

// Pass it as an additional parameter
var references = getReferences(issueId, shortDescription,
    ['short_description', 'description'], ['body'], issueType);&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Step 2:&lt;/STRONG&gt; Update the &lt;CODE&gt;getReferences&lt;/CODE&gt; function signature and source construction&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;function getReferences(issueId, shortDescription, fields, indexNames, issueType) {
    ...
    request.sources([
        new sn_search.RAGRetrievalSource()
            .sourceTableName('sn_grc_issue')
            .fields(FIELDS)
            .filter(true)
            .condition('issue_type=' + issueType)
    ]);
    ...
}&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example — filter by a fixed set of issue types&lt;/P&gt;
&lt;P&gt;To restrict results to a specific group of issue types (for example, all control-related types), use an encoded query with &lt;CODE&gt;^OR&lt;/CODE&gt; conditions:&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;request.sources([
    new sn_search.RAGRetrievalSource()
        .sourceTableName('sn_grc_issue')
        .fields(FIELDS)
        .filter(true)
        .condition('issue_type=7^ORissue_type=8^ORissue_type=9^ORissue_type=11')
]);&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example — filter by entity&lt;/P&gt;
&lt;P&gt;To only match historical issues from the same entity as the current issue:&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var entitySysId = issueGR.getValue("profile");

request.sources([
    new sn_search.RAGRetrievalSource()
        .sourceTableName('sn_grc_issue')
        .fields(FIELDS)
        .filter(true)
        .condition('profile=' + entitySysId)
]);&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example — combine multiple filter conditions&lt;/P&gt;
&lt;P&gt;Dynamic conditions follow GlideRecord encoded query syntax. You can combine conditions using &lt;CODE&gt;^&lt;/CODE&gt; (AND) and &lt;CODE&gt;^OR&lt;/CODE&gt; (OR):&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var entitySysId = issueGR.getValue("profile");
var issueType = issueGR.getValue("issue_type");

request.sources([
    new sn_search.RAGRetrievalSource()
        .sourceTableName('sn_grc_issue')
        .fields(FIELDS)
        .filter(true)
        .condition('profile=' + entitySysId + '^issue_type=' + issueType)
        .validateWithSearchProfile(true)
]);&lt;/PRE&gt;
&lt;DIV style="background-color: #e8f4fb; border-left: 4px solid #0070d2; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; The &lt;CODE&gt;.condition()&lt;/CODE&gt; method adds a runtime filter &lt;EM&gt;on top of&lt;/EM&gt; the search profile's existing filter. The static filter (&lt;CODE&gt;state=3^ORstate=4&lt;/CODE&gt;) still applies — your dynamic condition narrows results further, it does not replace the base filter. Adding &lt;CODE&gt;.validateWithSearchProfile(true)&lt;/CODE&gt; ensures the source configuration is validated against the search profile.&lt;/DIV&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;What you can safely change&lt;/P&gt;
&lt;P&gt;- Filter by any field on the &lt;CODE&gt;sn_grc_issue&lt;/CODE&gt; table — common choices include &lt;CODE&gt;issue_type&lt;/CODE&gt;, &lt;CODE&gt;profile&lt;/CODE&gt; (entity), and &lt;CODE&gt;assigned_to&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;- Use hardcoded values for fixed filters (e.g., always restrict to control-related issues) or dynamic values from the current issue record for contextual filters&lt;/P&gt;
&lt;P&gt;- Combine multiple conditions using encoded query syntax (&lt;CODE&gt;^&lt;/CODE&gt; for AND, &lt;CODE&gt;^OR&lt;/CODE&gt; for OR)&lt;/P&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Tradeoff:&lt;/STRONG&gt; Dynamic filters improve relevance by restricting matches to a comparable subset of historical issues. However, overly narrow filters — especially on instances with limited historical data — may result in too few or no matches. When the agent finds no similar records, no action plan can be generated. Test with representative issues to ensure your filters leave an adequate pool of reference data.&lt;/DIV&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION: TRADEOFFS ===================== --&gt;
&lt;H3 style="font-size: 18px; color: #0070d2; margin-top: 32px;"&gt;Tradeoffs at a Glance&lt;/H3&gt;
&lt;TABLE style="width: 100%; border-collapse: collapse; margin: 16px 0;"&gt;
&lt;THEAD&gt;
&lt;TR style="background: #f0f7ff;"&gt;
&lt;TH style="width: 25%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Customization&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 35%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Benefit&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 40%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Risk&lt;/P&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY style="font-weight: normal;"&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Broaden issue index filter&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;More reference data available for plan generation&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Issues without action plans are excluded at runtime — adding low-quality data doesn't help&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Lower similarity threshold&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;More past issues included; helpful on sparse datasets&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Loosely related patterns may dilute the generated plan&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Raise similarity threshold&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Only closely matched issues inform the plan&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;May return no results for new or uncommon issue types&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Increase match count&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Richer synthesis from more historical context&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Larger prompt sent to LLM; slower response time&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit agent instructions&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Tailor messages and flow to your org's tone and process&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;LLM is sensitive to wording — test thoroughly before deploying&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Enrich search query&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;More relevant historical matches when additional context is included&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Overly long queries may dilute semantic matching precision&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Add dynamic filters&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Results restricted to a comparable subset of historical issues&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Overly narrow filters may return too few matches on sparse datasets&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;!-- ===================== IMPORTANT NOTE ===================== --&gt;
&lt;DIV style="background-color: #fff3cd; border: 1px solid #f5a623; border-left: 5px solid #f5a623; padding: 16px 20px; margin: 24px 0; border-radius: 4px;"&gt;
&lt;P style="margin: 0 0 8px 0; font-size: 15px; font-weight: bold; color: #7a4f00;"&gt;⚠ Important: Testing and Upgrade Compatibility&lt;/P&gt;
&lt;P style="margin: 0 0 10px 0;"&gt;All customizations described in this article modify components that are part of the out-of-the-box use case delivery. Before deploying any change to production, test thoroughly in a sub-production instance using a representative set of real issue records — including issues with rich action plans, sparse action plans, and no historical matches.&lt;/P&gt;
&lt;P style="margin: 0 0 10px 0;"&gt;When ServiceNow ships upgrades to this use case — including changes to skill prompts, agent instructions, datasource scripts, or indexed source configuration — those updates will reflect the out-of-the-box defaults. Any customizations you have made will need to be reviewed, reconciled, and re-applied against the upgraded version. This includes:&lt;/P&gt;
&lt;UL style="margin: 0 0 10px 0; padding-left: 20px;"&gt;
&lt;LI&gt;Filter changes on the GRC issues indexed source&lt;/LI&gt;
&lt;LI&gt;Threshold and match count changes in the GetSimilarRecords tool script&lt;/LI&gt;
&lt;LI&gt;Search query enrichments in the GetSimilarRecords tool script&lt;/LI&gt;
&lt;LI&gt;Dynamic filter conditions in the GetSimilarRecords tool script&lt;/LI&gt;
&lt;LI&gt;Instruction changes in either agent&lt;/LI&gt;
&lt;/UL&gt;
&lt;P style="margin: 0;"&gt;Maintain clear documentation of every customization your organization applies, including the original out-of-the-box value and the reason for the change, to make upgrade reconciliation straightforward.&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Wed, 15 Apr 2026 13:05:35 GMT</pubDate>
    <dc:creator>GouthamAnumolu</dc:creator>
    <dc:date>2026-04-15T13:05:35Z</dc:date>
    <item>
      <title>Customizing the Optimize GRC Issue Resolution Use Case</title>
      <link>https://www.servicenow.com/community/grc-articles/customizing-the-optimize-grc-issue-resolution-use-case/ta-p/3521376</link>
      <description>&lt;H3 style="font-size: 18px; color: #0070d2; margin-top: 32px;"&gt;Overview&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Optimize GRC Issue Resolution use case works out of the box, but every organization has different data volumes, resolution patterns, and process expectations. This article covers every supported customization — from tuning which past issues are used as reference data, to adjusting how the action plan and remediation tasks are generated, and modifying agent behavior and messaging.&lt;/P&gt;
&lt;P&gt;The two agents and their skills are accessed from:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;&lt;SPAN&gt;Usecase: All → Now Assist AI Agents → AI Use Cases&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Agents: All → Now Assist AI Agents → AI Agents&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Skills: All → Now Assist Skill Kit → Skill&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Indexed Sources: All → Indexed Sources&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION: QUICK REFERENCE ===================== --&gt;
&lt;H3 style="font-size: 18px; color: #0070d2; margin-top: 32px;"&gt;Quick Reference&lt;/H3&gt;
&lt;TABLE style="width: 100%; border-collapse: collapse; margin: 16px 0;"&gt;
&lt;THEAD&gt;
&lt;TR style="background: #f0f7ff;"&gt;
&lt;TH style="width: 40%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;What you want to change&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 60%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;How&lt;/P&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY style="font-weight: normal;"&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-1" target="_self"&gt;Which resolved issues are used as reference data&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit the &lt;STRONG&gt;Issue closed&lt;/STRONG&gt; filter condition in the &lt;STRONG&gt;GRC issues&lt;/STRONG&gt; indexed source&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-2" target="_self"&gt;How similar a past issue must be to be included&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit &lt;CODE&gt;SCORE_THRESHOLD&lt;/CODE&gt; in the &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool of the &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; skill&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-3" target="_self"&gt;How many past issues are retrieved for comparison&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit &lt;CODE&gt;MATCH_COUNT&lt;/CODE&gt; in the &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool of the &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; skill&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-4" target="_self"&gt;Agent messages, flow behavior, and display format&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit instructions on the &lt;STRONG&gt;Issue Action Plan AI Agent&lt;/STRONG&gt; and &lt;STRONG&gt;Remediation Tasks AI Agent&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-5" target="_self"&gt;What context is used to find similar historical issues&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Enrich the search query in the &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool of the &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; skill&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;&lt;A style="color: #0070d2; text-decoration: none;" href="#section-6" target="_self"&gt;How to apply additional filters while performing RAG search on closed issues&lt;/A&gt;&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Add dynamic filter conditions in the&amp;nbsp;&lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool of the &lt;STRONG&gt;Issue Action Plan Generation skill&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION 1 ===================== --&gt;
&lt;DIV id="section-1" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;1. Adjusting Which Issues Are Used as Reference Data&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;The action plan generation only draws from issues that are closed. By default, this means issues in &lt;STRONG&gt;Closed Complete&lt;/STRONG&gt; or &lt;STRONG&gt;Closed Incomplete&lt;/STRONG&gt; state. You can change this filter to expand or narrow the pool of reference issues.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Navigate to&lt;/P&gt;
&lt;P&gt;All → Indexed Sources → search for &lt;STRONG&gt;GRC issues&lt;/STRONG&gt; → open → find the &lt;STRONG&gt;Issue closed&lt;/STRONG&gt; filter condition → edit.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Current filter&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;state = 3 (Closed Complete) OR state = 4 (Closed Incomplete)&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;What you can safely change&lt;/P&gt;
&lt;P&gt;- Add additional closed states if your organization uses custom issue states&lt;/P&gt;
&lt;P&gt;- Add further conditions to narrow the pool — for example, restrict to issues from a specific category or assigned group&lt;/P&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;Tradeoff: A broader filter increases the pool of reference issues and can improve plan quality — but only if those issues have meaningful action plans and remediation tasks. Issues without action plans or linked tasks are automatically excluded at runtime even if they pass the filter, so adding more states with poor data quality will not help. A narrower filter may leave too few relevant matches for sparse datasets.&lt;/DIV&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION 2 ===================== --&gt;
&lt;DIV id="section-2" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;2. Adjusting the Similarity Threshold&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;The similarity threshold controls how closely a past issue must match the current one before it is included in the comparison set. The default is &lt;STRONG&gt;80%&lt;/STRONG&gt;. A past issue that scores below this threshold is excluded regardless of how many results are available.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Navigate to&lt;/P&gt;
&lt;P&gt;All → Now Assist Skill Kit → Skill → search for &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; → open → Tools → open &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool → edit the script.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example snippet&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var SCORE_THRESHOLD = 0.80;  // default — lower to include more results, raise for stricter matching&lt;/PRE&gt;
&lt;TABLE style="width: 100%; border-collapse: collapse; margin: 16px 0;"&gt;
&lt;THEAD&gt;
&lt;TR style="background: #f0f7ff;"&gt;
&lt;TH style="width: 20%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Value&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 80%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Effect&lt;/P&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY style="font-weight: normal;"&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;0.70&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;More past issues included — useful when data is sparse but may introduce loosely related patterns&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;0.80 (default)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Balanced for most environments&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;0.90&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Only very closely matched issues included — higher precision but may return nothing on new issue types&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Tradeoff:&lt;/STRONG&gt; Lowering the threshold increases the number of reference issues but risks introducing irrelevant patterns into the generated plan. Raising it improves precision but may result in no plan being generated if your historical data is limited. Test against real issues in your instance before deploying.&lt;/DIV&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION 3 ===================== --&gt;
&lt;DIV id="section-3" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;3. Adjusting the Number of Past Issues Retrieved&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;By default, up to &lt;STRONG&gt;20 past issues&lt;/STRONG&gt; are retrieved and passed to the AI model for synthesis. All retrieved issues must also meet the similarity threshold — so the actual number sent to the model may be lower.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Navigate to&lt;/P&gt;
&lt;P&gt;All → Now Assist Skill Kit → Skill → search for &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; → open → Tools → open &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool → edit the script.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example snippet&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var MATCH_COUNT = 20;  // default — increase for richer synthesis, decrease to reduce latency&lt;/PRE&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Tradeoff:&lt;/STRONG&gt; A higher count gives the AI model more patterns to synthesize from, which can improve plan quality when your historical data is rich and varied. However, each retrieved issue includes its full action plan and all linked remediation tasks — a higher count increases the size of the prompt sent to the model and can slow response time. Keep the value within a reasonable range for your data volume.&lt;/DIV&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION 4 ===================== --&gt;
&lt;DIV id="section-4" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;4. Editing Agent Instructions&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;Each agent has its own instruction set that controls its conversational behavior — the messages it displays, how it presents options to the user, and how it handles each user choice. These are separate from the skill prompts and can be updated independently.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Issue Action Plan AI Agent&lt;/P&gt;
&lt;P&gt;Navigate to:&lt;BR /&gt;All → Now Assist AI Agents → AI Agents → search for &lt;STRONG&gt;Issue action plan AI agent&lt;/STRONG&gt; → open → edit the &lt;STRONG&gt;Instructions&lt;/STRONG&gt; field.&lt;/P&gt;
&lt;TABLE style="width: 100%; border-collapse: collapse; margin: 16px 0;"&gt;
&lt;THEAD&gt;
&lt;TR style="background: #f0f7ff;"&gt;
&lt;TH style="width: 30%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Part&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 70%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;What you can change&lt;/P&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY style="font-weight: normal;"&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Accept / Edit / Dismiss prompt&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;The wording of the options presented to the user after the action plan is shown&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Acceptance message&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;What the agent says when the user accepts — including the note about the plan being saved to the issue record&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Dismissal message&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;What the agent says when the user dismisses — currently tells the user to populate the plan manually&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit refinement behavior&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;How the agent asks for and incorporates feedback when the user chooses to edit&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Error messages&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;What the agent says when the issue record cannot be found or the plan cannot be generated&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Remediation Tasks AI Agent&lt;/P&gt;
&lt;P&gt;Navigate to:&lt;BR /&gt;All → Now Assist AI Agents → AI Agents → search for &lt;STRONG&gt;Remediation tasks AI agent&lt;/STRONG&gt; → open → edit the &lt;STRONG&gt;Instructions&lt;/STRONG&gt; field.&lt;/P&gt;
&lt;TABLE style="width: 100%; border-collapse: collapse; margin: 16px 0;" width="100%"&gt;
&lt;THEAD&gt;
&lt;TR style="background: #f0f7ff;"&gt;
&lt;TH style="width: 30%; padding: 10px; text-align: left; border: 1px solid #ddd;" width="30%"&gt;
&lt;P&gt;Part&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 70%; padding: 10px; text-align: left; border: 1px solid #ddd;" width="70%"&gt;
&lt;P&gt;What you can change&lt;/P&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY style="font-weight: normal;"&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD width="30%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Accept / Edit / Dismiss prompt&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="70%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;The wording of the options presented after task suggestions are shown&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="30%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Task display format&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="70%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;How suggested tasks are displayed when the user edits — currently uses a Name / Description format&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD width="30%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Acceptance message&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="70%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;The confirmation message after tasks are created — currently tells the user to assign owners manually&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="30%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Dismissal message&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="70%" style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;What the agent says when the user dismisses — currently tells the user to create tasks manually from the issue page&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Tradeoff:&lt;/STRONG&gt; The LLM is sensitive to instruction wording. Changes to how options are presented or how feedback is collected can affect agent behavior in non-obvious ways. Always test with a range of real issue scenarios before saving changes to production.&lt;/DIV&gt;
&lt;!-- ===================== SECTION 5 ===================== --&gt;
&lt;DIV id="section-5" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;5. Enriching the Search Query with Additional Issue Details&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;The search query is what drives semantic matching against historical issues. By default, the &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool searches using the current issue's &lt;CODE&gt;short_description&lt;/CODE&gt; — and optionally includes &lt;CODE&gt;description&lt;/CODE&gt; when the &lt;CODE&gt;use_description&lt;/CODE&gt; input is enabled. Adding more context from the issue record — such as entity name, issue type, or custom fields — can improve the relevance of the historical matches returned.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Navigate to&lt;/P&gt;
&lt;P&gt;All → Now Assist Skill Kit → Skill → search for &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; → open → Tools → open &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool → edit the script.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Current code — how the search query is built&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var shortDescription = '';
var issueId = '';
if (issueGR.next()) {
    shortDescription = issueGR.getValue("short_description");
    if (inputs.use_description === 'true') {
        shortDescription += "\n" + issueGR.getValue("description");
    }
    issueId = issueGR.getValue("sys_id");
}
var references = getReferences(issueId, shortDescription,
    ['short_description', 'description'], ['body']);&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Modified code — enrich the query with entity and issue type&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var shortDescription = '';
var issueId = '';
if (issueGR.next()) {
    shortDescription = issueGR.getValue("short_description");
    if (inputs.use_description === 'true') {
        shortDescription += "\n" + issueGR.getValue("description");
    }

    // Enrich the search query with additional issue context
    var entityName = issueGR.getDisplayValue("profile");
    var issueTypeLabel = issueGR.getDisplayValue("issue_type");
    if (entityName) {
        shortDescription += "\nEntity: " + entityName;
    }
    if (issueTypeLabel) {
        shortDescription += "\nIssue Type: " + issueTypeLabel;
    }

    issueId = issueGR.getValue("sys_id");
}
var references = getReferences(issueId, shortDescription,
    ['short_description', 'description'], ['body']);&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;What you can safely change&lt;/P&gt;
&lt;P&gt;- Add any field from the &lt;CODE&gt;sn_grc_issue&lt;/CODE&gt; record to the query string — use &lt;CODE&gt;getDisplayValue()&lt;/CODE&gt; for reference fields to include the display name rather than the sys_id&lt;/P&gt;
&lt;P&gt;- Include custom fields your organization has added to the issue table&lt;/P&gt;
&lt;P&gt;- Adjust or remove the &lt;CODE&gt;\n&lt;/CODE&gt; separator — the semantic search treats the entire string as context, so the separator style has minimal impact&lt;/P&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Tradeoff:&lt;/STRONG&gt; Adding relevant context (like entity name or issue type) helps the semantic search find more precisely related historical issues. However, adding too many fields or irrelevant data can dilute the query and reduce match quality. Start with one or two additional fields and test against real issues to measure improvement.&lt;/DIV&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION 6 ===================== --&gt;
&lt;DIV id="section-6" style="background-color: #e8f4fb; border-left: 5px solid #0070d2; padding: 10px 16px; margin: 20px 0 8px 0;"&gt;
&lt;H4 style="margin: 0; font-size: 16px; color: #00467f;"&gt;6. Adding Dynamic Filters to RAG Search&lt;/H4&gt;
&lt;/DIV&gt;
&lt;P&gt;By default, the RAG search returns all closed issues that match the search profile's static filter (&lt;CODE&gt;state=3^ORstate=4&lt;/CODE&gt;). If your organization needs to narrow results further at runtime — for example, to only compare against issues of the same type or issues related to a specific entity — you can add dynamic filter conditions using the &lt;CODE&gt;.condition()&lt;/CODE&gt; method on the &lt;CODE&gt;RAGRetrievalSource&lt;/CODE&gt;.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Navigate to&lt;/P&gt;
&lt;P&gt;All → Now Assist Skill Kit → Skill → search for &lt;STRONG&gt;Issue Action Plan Generation&lt;/STRONG&gt; → open → Tools → open &lt;STRONG&gt;GetSimilarRecords&lt;/STRONG&gt; tool → edit the script.&lt;/P&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Current code — source construction without dynamic filters&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;request.sources([
    new sn_search.RAGRetrievalSource()
        .sourceTableName('sn_grc_issue')
        .fields(FIELDS)
        .filter(true)
]);&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example — filter by the current issue's type&lt;/P&gt;
&lt;P&gt;This restricts results to historical issues that share the same issue type as the current issue. You will need to pass the issue type value into the &lt;CODE&gt;getReferences&lt;/CODE&gt; function.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Step 1:&lt;/STRONG&gt; Extract the issue type and pass it to &lt;CODE&gt;getReferences&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;// After querying issueGR, extract the issue type
var issueType = issueGR.getValue("issue_type");

// Pass it as an additional parameter
var references = getReferences(issueId, shortDescription,
    ['short_description', 'description'], ['body'], issueType);&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Step 2:&lt;/STRONG&gt; Update the &lt;CODE&gt;getReferences&lt;/CODE&gt; function signature and source construction&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;function getReferences(issueId, shortDescription, fields, indexNames, issueType) {
    ...
    request.sources([
        new sn_search.RAGRetrievalSource()
            .sourceTableName('sn_grc_issue')
            .fields(FIELDS)
            .filter(true)
            .condition('issue_type=' + issueType)
    ]);
    ...
}&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example — filter by a fixed set of issue types&lt;/P&gt;
&lt;P&gt;To restrict results to a specific group of issue types (for example, all control-related types), use an encoded query with &lt;CODE&gt;^OR&lt;/CODE&gt; conditions:&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;request.sources([
    new sn_search.RAGRetrievalSource()
        .sourceTableName('sn_grc_issue')
        .fields(FIELDS)
        .filter(true)
        .condition('issue_type=7^ORissue_type=8^ORissue_type=9^ORissue_type=11')
]);&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example — filter by entity&lt;/P&gt;
&lt;P&gt;To only match historical issues from the same entity as the current issue:&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var entitySysId = issueGR.getValue("profile");

request.sources([
    new sn_search.RAGRetrievalSource()
        .sourceTableName('sn_grc_issue')
        .fields(FIELDS)
        .filter(true)
        .condition('profile=' + entitySysId)
]);&lt;/PRE&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;Example — combine multiple filter conditions&lt;/P&gt;
&lt;P&gt;Dynamic conditions follow GlideRecord encoded query syntax. You can combine conditions using &lt;CODE&gt;^&lt;/CODE&gt; (AND) and &lt;CODE&gt;^OR&lt;/CODE&gt; (OR):&lt;/P&gt;
&lt;PRE style="background-color: #f5f5f5; padding: 12px 16px; border-left: 4px solid #cccccc; font-size: 13px; overflow-x: auto;"&gt;var entitySysId = issueGR.getValue("profile");
var issueType = issueGR.getValue("issue_type");

request.sources([
    new sn_search.RAGRetrievalSource()
        .sourceTableName('sn_grc_issue')
        .fields(FIELDS)
        .filter(true)
        .condition('profile=' + entitySysId + '^issue_type=' + issueType)
        .validateWithSearchProfile(true)
]);&lt;/PRE&gt;
&lt;DIV style="background-color: #e8f4fb; border-left: 4px solid #0070d2; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; The &lt;CODE&gt;.condition()&lt;/CODE&gt; method adds a runtime filter &lt;EM&gt;on top of&lt;/EM&gt; the search profile's existing filter. The static filter (&lt;CODE&gt;state=3^ORstate=4&lt;/CODE&gt;) still applies — your dynamic condition narrows results further, it does not replace the base filter. Adding &lt;CODE&gt;.validateWithSearchProfile(true)&lt;/CODE&gt; ensures the source configuration is validated against the search profile.&lt;/DIV&gt;
&lt;P style="font-weight: bold; color: #00467f; margin-top: 20px; border-bottom: 1px solid #d0e8f5; padding-bottom: 4px;"&gt;What you can safely change&lt;/P&gt;
&lt;P&gt;- Filter by any field on the &lt;CODE&gt;sn_grc_issue&lt;/CODE&gt; table — common choices include &lt;CODE&gt;issue_type&lt;/CODE&gt;, &lt;CODE&gt;profile&lt;/CODE&gt; (entity), and &lt;CODE&gt;assigned_to&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;- Use hardcoded values for fixed filters (e.g., always restrict to control-related issues) or dynamic values from the current issue record for contextual filters&lt;/P&gt;
&lt;P&gt;- Combine multiple conditions using encoded query syntax (&lt;CODE&gt;^&lt;/CODE&gt; for AND, &lt;CODE&gt;^OR&lt;/CODE&gt; for OR)&lt;/P&gt;
&lt;DIV style="background-color: #f5f5f5; border-left: 4px solid #aaaaaa; padding: 10px 16px; margin: 16px 0; font-size: 14px;"&gt;&lt;STRONG&gt;Tradeoff:&lt;/STRONG&gt; Dynamic filters improve relevance by restricting matches to a comparable subset of historical issues. However, overly narrow filters — especially on instances with limited historical data — may result in too few or no matches. When the agent finds no similar records, no action plan can be generated. Test with representative issues to ensure your filters leave an adequate pool of reference data.&lt;/DIV&gt;
&lt;HR /&gt;&lt;!-- ===================== SECTION: TRADEOFFS ===================== --&gt;
&lt;H3 style="font-size: 18px; color: #0070d2; margin-top: 32px;"&gt;Tradeoffs at a Glance&lt;/H3&gt;
&lt;TABLE style="width: 100%; border-collapse: collapse; margin: 16px 0;"&gt;
&lt;THEAD&gt;
&lt;TR style="background: #f0f7ff;"&gt;
&lt;TH style="width: 25%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Customization&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 35%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Benefit&lt;/P&gt;
&lt;/TH&gt;
&lt;TH style="width: 40%; padding: 10px; text-align: left; border: 1px solid #ddd;"&gt;
&lt;P&gt;Risk&lt;/P&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY style="font-weight: normal;"&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Broaden issue index filter&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;More reference data available for plan generation&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Issues without action plans are excluded at runtime — adding low-quality data doesn't help&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Lower similarity threshold&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;More past issues included; helpful on sparse datasets&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Loosely related patterns may dilute the generated plan&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Raise similarity threshold&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Only closely matched issues inform the plan&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;May return no results for new or uncommon issue types&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Increase match count&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Richer synthesis from more historical context&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Larger prompt sent to LLM; slower response time&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Edit agent instructions&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Tailor messages and flow to your org's tone and process&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;LLM is sensitive to wording — test thoroughly before deploying&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Enrich search query&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;More relevant historical matches when additional context is included&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Overly long queries may dilute semantic matching precision&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="background-color: #f9f9f9;"&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Add dynamic filters&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Results restricted to a comparable subset of historical issues&lt;/P&gt;
&lt;/TD&gt;
&lt;TD style="padding: 8px; border: 1px solid #ddd;"&gt;
&lt;P&gt;Overly narrow filters may return too few matches on sparse datasets&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;!-- ===================== IMPORTANT NOTE ===================== --&gt;
&lt;DIV style="background-color: #fff3cd; border: 1px solid #f5a623; border-left: 5px solid #f5a623; padding: 16px 20px; margin: 24px 0; border-radius: 4px;"&gt;
&lt;P style="margin: 0 0 8px 0; font-size: 15px; font-weight: bold; color: #7a4f00;"&gt;⚠ Important: Testing and Upgrade Compatibility&lt;/P&gt;
&lt;P style="margin: 0 0 10px 0;"&gt;All customizations described in this article modify components that are part of the out-of-the-box use case delivery. Before deploying any change to production, test thoroughly in a sub-production instance using a representative set of real issue records — including issues with rich action plans, sparse action plans, and no historical matches.&lt;/P&gt;
&lt;P style="margin: 0 0 10px 0;"&gt;When ServiceNow ships upgrades to this use case — including changes to skill prompts, agent instructions, datasource scripts, or indexed source configuration — those updates will reflect the out-of-the-box defaults. Any customizations you have made will need to be reviewed, reconciled, and re-applied against the upgraded version. This includes:&lt;/P&gt;
&lt;UL style="margin: 0 0 10px 0; padding-left: 20px;"&gt;
&lt;LI&gt;Filter changes on the GRC issues indexed source&lt;/LI&gt;
&lt;LI&gt;Threshold and match count changes in the GetSimilarRecords tool script&lt;/LI&gt;
&lt;LI&gt;Search query enrichments in the GetSimilarRecords tool script&lt;/LI&gt;
&lt;LI&gt;Dynamic filter conditions in the GetSimilarRecords tool script&lt;/LI&gt;
&lt;LI&gt;Instruction changes in either agent&lt;/LI&gt;
&lt;/UL&gt;
&lt;P style="margin: 0;"&gt;Maintain clear documentation of every customization your organization applies, including the original out-of-the-box value and the reason for the change, to make upgrade reconciliation straightforward.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Apr 2026 13:05:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/grc-articles/customizing-the-optimize-grc-issue-resolution-use-case/ta-p/3521376</guid>
      <dc:creator>GouthamAnumolu</dc:creator>
      <dc:date>2026-04-15T13:05:35Z</dc:date>
    </item>
  </channel>
</rss>

