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.
- In Zendesk, open Admin > Apps & Integrations > Webhooks > Actions, and then click Create Webhook.
- Configure the following fields, as described below:
- Title — Agent Connect
- Endpoint URL — https://api.stellaconnect.net/v1/auth
- Request Method — POST
- Request Format — JSON
- Authentication — Basic Authentication
- Username — connect
- Password — Your Agent Connect Test API Key.
- 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" }
- 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 Agent 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.
- In Zendesk, open Admin > Manage > Ticket Fields, and then click Add custom field.
- Select Checkbox.
- In the For agents field, enter Do not Send Stella Connect Survey.
- Click Add field.
- 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
- 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.
- Create a trigger for interactions occurring through the email channel.
- In Zendesk, open Admin > Business Rules > Triggers, and then click Add a trigger.
- Name the trigger Agent Connect - Email.
- Specify the following meets-all conditions:
- Status - Changed to - Solved
- Assignee - Is not - Blank
- Comment - Is - Present and requester can see comment
- Specify the following meets-any conditions:
- Channel - Is - Email
- Channel - Is - Web Form
- Channel - Is - Web Widget
- Under Actions, select Notify Active Webhook, and then select the webhook you created in Creating a webhook, above.
- 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. - In the JSON code, replace CUSTOM_ID with the actual ID of the custom field you created in Creating a Do Not Send Agent Connect Survey field, above.
- Save the trigger.
- If needed, create a trigger for interactions occurring through the phone channel.
- In Zendesk, open Admin > Business Rules > Triggers, and then click Add a trigger.
- Name the trigger Agent Connect - Phone.
- Specify the following meets-all conditions:
- Status - Changed to - Solved
- Assignee - Is not - Blank
- Specify the following meets-any conditions:
- Channel - Is - Phone call incoming
- Channel - Is - Phone call outgoing
- Channel - Is - Voicemail
- Under Actions, select Notify Active Webhook, and then select the webhook you created earlier.
- 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. - In the JSON code, replace CUSTOM_ID with the actual ID of the custom field you created earlier.
- Save the trigger.
- If needed, create a trigger for interactions occurring through the chat channel.
- In Zendesk, open Admin > Business Rules > Triggers, and then click Add a trigger.
- Name the trigger Agent Connect - Chat.
- Specify the following meets-all conditions:
- Status - Changed to - Solved
- Assignee - Is not - Blank
- Comment - Is - Present and requester can see comment
- Specify Channel - Is - Chat as the meets-any condition.
- Under Actions, select Notify Active Webhook, and then select the webhook you created earlier.
- 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. - In the JSON code, replace CUSTOM_ID with the actual ID of the custom field you created earlier.
- Save the trigger.
- 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.
- In Zendesk, open Admin > Business Rules > Triggers, and then click Add a trigger.
- Name the trigger Agent Connect - Do Not Send.
- Specify the meets-all and meets-any conditions needed by your company.
- Under Actions, select the Do not Send Agent Connect Survey field, and then select checked.
- 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.
- 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 %}] }
- 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.
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.
- In Zendesk, open the webhook you configured in Creating a webhook, above.
- Change the Password to your Agent Connect Production API Key (available on the Integrations screen in Agent Connect).
- At the bottom of the screen, select Update, and then click Submit.
- In Agent Connect, open the Integrations setup screen.
- For each channel you integrated, switch that field to On, and then click Update.
- 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.
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.
- In Zendesk, open Admin > Business Rules > Triggers, and then click Add a trigger.
- Provide a name the trigger.
For example, if the trigger is for the SMS channel, name it Agent Connect - SMS.
- 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)
- Specify any meets-any conditions needed by your team.
- Under Actions, select Notify Active Webhook, and then select the webhook you created in Creating a webhook, above.
- 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 earlier. 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"}
- Use the following example code for SMS channels:
- Save the trigger.