Integrating surveys with Zendesk

Feedback in Agent Connect links directly to Zendesk, enabling your team to see the tickets related to specific pieces of feedback.

Integrate Medallia Agent Connect and Zendesk to send survey requests when tickets are solved. For phone, email, and chat channels you can send feedback requests to customers automatically after your team closes tickets in Zendesk. For other channels you can include survey links directly in your Zendesk tickets.

Creating a webhook

Create a webhook for Zendesk and Agent Connect to share JSON-formatted information.

  1. In Zendesk, open Admin > Apps & Integrations > Webhooks > Actions, and then click Create Webhook.
  2. Configure the following fields, as described below:
    • TitleStella Connect
    • Endpoint URLhttps://api.stellaconnect.net/v1/auth
    • Request MethodPOST
    • Request FormatJSON
    • AuthenticationBasic Authentication
    • Usernameconnect
    • Password — Your Agent Connect Test API Key.
  3. In the JSON code box, enter the following code and then click Send Test:
    {
      "customer": {
        "name": "pete",
        "email":"pete@stellaservice.com"
      },
      "do_not_send": true,
      "employee": {
        "email": "pete.sellar@stellaservice.com"
      },
      "channel": "phone"
    }
  4. After a successful test (showing an HTTP/1.1 200 OK message), at the bottom of the screen click Create.

Creating a Do Not Send Stella Connect Survey field

Create a checkbox field that enables agents to prevent a Agent Connect survey from being sent when they solve a ticket. Note the field ID of the field you create, which is used in Zendesk triggers.

  1. In Zendesk, open Admin > Manage > Ticket Fields, and then click Add custom field.
  2. Select Checkbox.
  3. In the For agents field, enter Do not Send Stella Connect Survey.
  4. Click Add field.
  5. Note the ID of the new field, listed at the top of the screen.

    The field ID is needed when creating triggers, as described below.

Creating triggers that email surveys automatically

Important: Agent Connect can send surveys automatically only when the following criteria are met:
  • The Team Member that has resolved the Zendesk ticket has an approved Agent Connect profile.
  • The customer’s record includes an email address.
  • A Team Member is assigned to the case when it is solved. To configure Zendesk to assign ticket ownership automatically, in Zendesk open Admin > Settings > Tickets > Assignment, and then turn on the Auto-assign tickets upon solve property.

Create the triggers that enable Agent Connect to email surveys to customers automatically when tickets in Zendesk are closed.

  1. Create a trigger for interactions occurring through the email channel.
    1. In Zendesk, open Admin > Business Rules > Triggers, and then click Add a trigger.
    2. Name the trigger Stella Connect - Email.
    3. Specify the following meets-all conditions:
      • Status - Changed to - Solved
      • Assignee - Is not - Blank
      • Comment - Is - Present and requester can see comment
    4. Specify the following meets-any conditions:
      • Channel - Is - Email
      • Channel - Is - Web Form
      • Channel - Is - Web Widget
    5. Under Actions, select Notify Active Webhook, and then select the webhook you created in Creating a webhook, above.
    6. In the JSON code box, enter the following code:
      { "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "email", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip %}"email":{% if customer_email and customer_email != "" %}"{{customer_email}}"{% else %}"no_email"{% endif %} }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' %}"tags": [{% for tag in raw_tags %}"{{tag}}"{% unless forloop.last %},{% endunless %}{% endfor %}]}
      Note: The example code contains both JSON and Liquid tags to ensure Zendesk tags are parsed in the correct format for Agent Connect.
    7. In the JSON code, replace CUSTOM_ID with the actual ID of the custom field you created in Creating a Do Not Send Stella Connect Survey field, above.
    8. Save the trigger.
  2. If needed, create a trigger for interactions occurring through the phone channel.
    1. In Zendesk, open Admin > Business Rules > Triggers, and then click Add a trigger.
    2. Name the trigger Stella Connect - Phone.
    3. Specify the following meets-all conditions:
      • Status - Changed to - Solved
      • Assignee - Is not - Blank
    4. Specify the following meets-any conditions:
      • Channel - Is - Phone call incoming
      • Channel - Is - Phone call outgoing
      • Channel - Is - Voicemail
    5. Under Actions, select Notify Active Webhook, and then select the webhook you created earlier.
    6. In the JSON code box, enter the following code:
      { "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "phone", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip %}"email":{% if customer_email and customer_email != "" %}"{{customer_email}}"{% else %}"no_email"{% endif %} }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' %}"tags": [{% for tag in raw_tags %}"{{tag}}"{% unless forloop.last %},{% endunless %}{% endfor %}]}
      Note: The example code contains both JSON and Liquid tags to ensure Zendesk tags are parsed in the correct format for Agent Connect.
    7. In the JSON code, replace CUSTOM_ID with the actual ID of the custom field you created earlier.
    8. Save the trigger.
  3. If needed, create a trigger for interactions occurring through the chat channel.
    1. In Zendesk, open Admin > Business Rules > Triggers, and then click Add a trigger.
    2. Name the trigger Stella Connect - Chat.
    3. Specify the following meets-all conditions:
      • Status - Changed to - Solved
      • Assignee - Is not - Blank
      • Comment - Is - Present and requester can see comment
    4. Specify Channel - Is - Chat as the meets-any condition.
    5. Under Actions, select Notify Active Webhook, and then select the webhook you created earlier.
    6. In the JSON code box, enter the following code:
      { "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "chat", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip %}"email":{% if customer_email and customer_email != "" %}"{{customer_email}}"{% else %}"no_email"{% endif %} }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' %}"tags": [{% for tag in raw_tags %}"{{tag}}"{% unless forloop.last %},{% endunless %}{% endfor %}]}
      Note: The example code contains both JSON and Liquid tags to ensure Zendesk tags are parsed in the correct format for Agent Connect.
    7. In the JSON code, replace CUSTOM_ID with the actual ID of the custom field you created earlier.
    8. Save the trigger.
  4. Optionally, create a trigger to automatically prevent surveys from being sent under specific conditions.
    Note: You do not need to create a trigger specifically to limit the number of surveys that a customer receives within a specific period of time. On the Company Info screen, Agent Connect includes a suppression period that automatically stops surveys from flooding a customer within a specified number of days. For more information, see Company information.
    1. In Zendesk, open Admin > Business Rules > Triggers, and then click Add a trigger.
    2. Name the trigger Stella Connect - Do Not Send.
    3. Specify the meets-all and meets-any conditions needed by your company.
    4. Under Actions, select the Do not Send Stella Connect Survey field, and then select checked.
    5. Save the trigger.
      Important: To make sure Zendesk checks your desired business rules before sending a Agent Connect request, in the list of triggers order this exception trigger above all of the triggers that send requests.
  5. Optionally, make revisions to the JSON payloads listed above to account for advanced configurations used by your company.
    Note: The example code contains both JSON and Liquid tags to ensure Zendesk tags are parsed in the correct format for Agent Connect.
    • If you want to map one or more custom fields in Zendesk to Agent Connect tags, modify the JSON payload to include those fields, as shown in the following JSON example. Your custom field must contain a value when the ticket is solved, else Agent Connect shows a dash (-) for that tag.
      { "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "email", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip %}"email":{% if customer_email and customer_email != "" %}"{{customer_email}}"{% else %}"no_email"{% endif %} }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": {{ticket.link}}", "tags": ["{{ticket.ticket_field_option_title_CUSTOM_ID}}", "{{ticket.ticket_field_option_title_CUSTOM_ID}}"]}
    • If you use multiple brands in Agent Connect, modify the JSON payload to indicate the brand for each interaction, as shown in the following JSON example:
      { "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "email", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip %}"email":{% if customer_email and customer_email != "" %}"{{customer_email}}"{% else %}"no_email"{% endif %} }, "ext_interaction_id": "{{ticket.id}}", "brand": "{{ticket.brand.name}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' %}"tags": [{% for tag in raw_tags %}"{{tag}}"{% unless forloop.last %},{% endunless %}{% endfor %}] }
    • If you use multiple languages in Agent Connect, modify the JSON payload to indicate the language code for each interaction, as shown in the following JSON example. For information about the language codes used in Zendesk, see the Zendesk language support by product article on the Zendesk support site.
      { "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "email", "customer": { "name": "{{ticket.requester.name}}", {% assign customer_email = ticket.requester.email | strip %}"email":{% if customer_email and customer_email != "" %}"{{customer_email}}"{% else %}"no_email"{% endif %} }, "ext_interaction_id": "{{ticket.id}}", "language": "{{ticket.requester.locale}}", "do_not_send": "{{ticket.ticket_field_YOUR CUSTOM ID HERE}}", "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' %}"tags": [{% for tag in raw_tags %}"{{tag}}"{% unless forloop.last
      %},{% endunless %}{% endfor %}] }

Moving your automated integration to production

Work with your Agent Connect Client Success Manager to test your automated integration, and to resolve any issues. When everything is working as expected, move your integration to production.

  1. In Zendesk, open the webhook you configured in Creating a webhook, above.
  2. Change the Password to your Agent Connect Production API Key (available on the Integrations screen in Agent Connect).
  3. At the bottom of the screen, select Update, and then click Submit.
  4. In Agent Connect, open the Integrations setup screen.
  5. For each channel you integrated, switch that field to On, and then click Update.

    Integrated Channels in Stella Connect

  6. In Zendesk, turn off the automated CSAT survey and the chat rating.

Creating triggers that include a survey link in Zendesk responses

Sending survey requests to customers via email after a ticket is solved is not always possible. For example, tickets using social or text (SMS) channels might not include a customer email. Additionally, your company's customer-contact policies might restrict email communication.

To provide more flexible sending options, Agent Connect enables you to add a survey link inside Zendesk tickets when the tickets are solved.

Determine which channels your team uses to communicate with customers, and consider the conditions needed for your triggers. The following procedure includes JSON examples for SMS and social media channels. Work with your Agent Connect Client Success Manager to develop and test your triggers for these, and other channels used by your team.

Consider the following points before configuring your tickets to include survey links:

  • Make sure that for the channels you want to include a survey link, there are no existing triggers that already send surveys by email for the same tickets.
  • Some channels might not be best suited for this integration. For example, channels for which agents need to solve a ticket at a later time (such as Zendesk chats) might not be suitable, since the customer might have already left the chat before the agent solves the ticket.
  • For Zendesk to automatically redact a survey link so it is not visible to your agents, you must enable the Agents can delete tickets feature in Zendesk. (For more information, see the Enabling agents to delete tickets article on the Zendesk Support site.) If you want survey links redacted so that agents cannot see the link or fill out the surveys themselves, note that redaction can take up to a few seconds. This is a byproduct of the Zendesk redaction functionality.
Note: Because Agent Connect does not send surveys when using the Test API Key, this integration requires that you use your Production API Key to see survey links as public comments when your agent solves a ticket. If you have configured the integration steps described in and , above, you have already updated your HTTP target to use the Production API Key.

You can help with your testing by adding a condition to your triggers requiring a tag named surveylinktest, or something similar, and then adding that tag to any test ticket you create. When you are ready to use this integration with customers, remove that condition from your triggers.

  1. In Zendesk, open Admin > Business Rules > Triggers, and then click Add a trigger.
  2. Provide a name the trigger.

    For example, if the trigger is for the SMS channel, name it Stella Connect - SMS.

  3. Specify the meets-all conditions needed by your team.

    Medallia recommends using all of the following conditions:

    • Status - Changed to - Solved
    • Assignee - Is not - Blank
    • Comment - Is - Present and requester can see comment
    • Channel - Is - (SMS, Social, and so on, depending on the trigger you are creating)
  4. Specify any meets-any conditions needed by your team.
  5. Under Actions, select Notify Active Webhook, and then select the webhook you created in Creating a webhook, above.
  6. In the JSON code box, enter the code for your trigger. In the following examples, replace CUSTOM_ID with the actual ID of the custom field you created in Creating a Do Not Send Stella Connect Survey field, above.
    Note: The actual channel name might be email, facebook, or twitter, and so on. The channel name must match one that exists in your Agent Connect account. Work with your Agent Connect Client Success Manager to enable any custom channels you need.
    Note: The example code contains both JSON and Liquid tags to ensure Zendesk tags are parsed in the correct format for Agent Connect.
    • Use the following example code for SMS channels:
      { "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "sms", "customer": { "name": "{{ticket.requester.name}}", "email": "{{ticket.requester.email}}", "phone_number": "{{ticket.requester.phone}}" }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}",  "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' %}"tags": [{% for tag in raw_tags %}"{{tag}}"{% unless forloop.last %},{% endunless %}{% endfor %}], "deliver_via": "zendesk_support", "brand": "{{ticket.brand.name}}" "language" : "en"}
    • Use the following example code for social media channels.
      { "employee": { "email": "{{ticket.assignee.email}}" }, "channel": "social", "customer": { "name": "{{ticket.requester.name}}", "email": "{{ticket.requester.email}}", }, "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.ticket_field_CUSTOM_ID}}",  "external_url": "{{ticket.link}}", {% assign raw_tags = ticket.tags | split: ' ' %}"tags": [{% for tag in raw_tags %}"{{tag}}"{% unless forloop.last %},{% endunless %}{% endfor %}], "deliver_via": "zendesk_support", "brand": "{{ticket.brand.name}}" "language" : "en"}
  7. Save the trigger.