Coveo Case Deflection Component

The Coveo Case Deflection component lets you display relevant content that dynamically changes depending on the content of a request.

The Coveo Case Deflection component requires Zendesk v0.0.2 or later.

Use the Coveo Case Deflection Component

For steps on accessing the folders in the Customize design window of Zendesk, see Customizing your help center theme.

  1. Go to your theme customization page and click Edit Code.

  2. Locate the page template that corresponds to the new request page (generally new_request_page.hbs).

  3. Enter your page template code where indicated in the code block.

    <CoveoCaseDeflection>
      <!-- Replace this comment with your page template -->
    </CoveoCaseDeflection>

Use Coveo Hosted Search Pages for Case Deflection

The Coveo Case Deflection component can be used in conjunction with the Coveo Hosted Search Page component. To do so, you must replace your page template with the Coveo Hosted Search Page component.

<CoveoCaseDeflection>
  <CoveoHostedSearchPage data-page-name='ZendeskCaseDeflection' />
</CoveoCaseDeflection>

When you save and reload the page, you will see the results displayed on your new request page.

For increased accessibility, you can modify the layout to display the form and the results side by side. For example:

<div id="main-content" style="display:flex;">
  <div style="flex: 50%;">
  </div>
  	<CoveoCaseDeflection style="flex: 50%">
  	<CoveoHostedSearchPage data-page-name='ZendeskCaseDeflection' />
  	</CoveoCaseDeflection>
</div>

Filter Results with Request Context

Once the component is in place, you can see additional context sent with every Coveo query request. Upon opening the browser developer tool, you can locate a REST query going to https://platform.cloud.coveo.com/rest/search/v2.

By scrolling to the bottom, you’ll see the context parameter. This parameter sends a JSON with the attributes of the request and should look like this:

context: {"subject":"Issues with my widget","description":"My widget is broken"}

The keys in this JSON are useful for configuring your Case Deflection Component where you’ll configure your query pipeline. Any key in this JSON can be used in your query pipeline. For example:

$context.subject

Configure Your Case Deflection Component

  1. In your Coveo organization, select or create the query pipeline used by your Case Deflection Component.

  2. In the Machine Learning tab, add a new Coveo ML model, such as an Automatic Relevance Tuning (ART) model, with the Enable Intelligent Term Detection (ITD) option selected.

  3. In the Query Parameters tab, add rules overriding the basic query expression and the large query expression parameter values.

  4. Click the Action Menu, and then select Add query parameters rule with code.

  5. On the Add a Rule With Code subpage, in the form editor box, enter the following rules:

    override query q:"<@+ $context.subject +@>"
    override query lq:"<@+ $context.description +@>"
  6. Click Add With Code.

  7. Back in the Query Parameters tab, click the created rules, and then in the Action Bar, click Edit.

  8. In the Edit a Query Parameter Rule subpage that opens, under Condition, select or create a condition that applies when an empty query is performed.

  9. Click Save.

If you enabled the query syntax in your Case Deflection Component, you must remove the <@+ and +@> markers from the query parameter rule overriding the basic query expression (q). When the query syntax is enabled, you must enter the following rules:

override query q:"$context.subject"
override query lq:"<@+ $context.description +@>"
Recommended Articles