Case Deflection component

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

Note

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’ll see the results displayed on your new request page.

Note

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. See Configure an Automatic Relevance Tuning model for Case Deflection or Case Assist Document Suggestions for instructions on how to create a Coveo ML ART model that’s optimized for case deflection.

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

  4. Click Menu, and then select Add 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 click Edit in the Action bar.

  8. On 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.

Important

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 +@>"