Service recovery in Zendesk

Send follow-up surveys when service recovery tickets are solved.

A service recovery integration creates follow-up tickets in your Zendesk instance when a survey response meets specific criteria (such as receiving a three-star or lower response to a Star Rating question). This guide details the steps for creating a webhook and trigger for service recovery interactions, testing the integration, and moving it to production when finished.

Tip: When the service recovery ticket is created in Zendesk, Agent Connect adds the stellaconnect_service_recovery tag to the ticket. Consider using this tag to create a view in Zendesk for organizing your service recovery workflow.

Create a webhook

The service recovery integration requires sending requests to a different Agent Connect API endpoint than the webhook used for survey integrations. When your team solves a follow-up ticket, your service recovery trigger will send a request to the webhook, which will then send a service recovery survey to your customer.

For more information about creating service recovery surveys in Agent Connect, see Service recovery.

Follow the steps below to create a webhook that enables Zendesk and Agent Connect to share JSON-formatted information.

  1. In Zendesk, open Apps & Integrations > Webhooks > Actions, then click Create Webhook.

  2. Configure the following fields, as described below:

    • TitleAgent Connect Service Recovery

    • Endpoint URL — https://api.stellaconnect.net/v1/recoveries

    • Request Method — POST

    • Request Format — JSON

    • Authentication — Basic Authentication

    • Username — connect

    • Password — Your Agent Connect Test API Key.

  3. In the JSON code field, enter the following test code and click Send Test:
    {
       "do_not_send": true,
       "tags": [
         "compensation provided"
       ],
       "employee": {
         "email": "pete.sellar@blancapeak.com"
       },
       "initial_feedback_request_id": "54bd2af9-28cb-48df-8c60-cd27de080cd4",
       "ext_interaction_id": "64664523",
       "external_url": "https://blancapeak.your-source-system.com/cases/64664523"
    }
  4. After a successful test showing a 200 OK response, click Create.

Create a trigger

Create a trigger that enables Agent Connect to email follow-up surveys to customers automatically when your service recovery criteria are met.

  1. In Zendesk, open Admin > Business Rules > Triggers, then click Add a trigger.

  2. Name the trigger "Agent Connect - Service Recovery".

  3. At minimum, specify the following meets-all conditions:

    • Status - Changed to - Solved

    • Tags - Contains at least one of the following - stellaconnect_service_recovery

  4. Specify the following meets-any conditions:

    • Channel - Is - Email

    • Channel - Is - Web Form

    • Channel - Is - Web Widget

  5. Under the Actions header, select "Notify Active Webhook", then select the webhook you created earlier.

  6. In the JSON code field, enter the following code:
    {
        "employee": {
            "email": "{{ticket.assignee.email}}"
        },
        "initial_feedback_request_id": "{{ticket.external_id}}",
        "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 for your Do Not Send field.

    For more information, see Integrate surveys with Zendesk.

  8. Save the trigger.

Update existing triggers for initial surveys

The main Zendesk integration includes triggers for sending emails when tickets are solved. Updating these triggers to exclude service recovery tickets ensures that when service recovery follow-up tickets are solved, the initial survey trigger does not fire, thereby sending the wrong survey to your customer.

For every trigger configured in the main integration, add the following to your meets-all criteria:

  • Tags - Contains none of the following - stellaconnect_service_recovery

Test the integration

Create a ticket in Zendesk to test your workflow via the steps below:

  1. Act as the customer by requesting a support ticket from your own email address.

  2. Open the ticket in Zendesk, leave a comment, then solve the ticket.

    Your original survey trigger should fire, sending you an Agent Connect survey.

  3. Respond to the survey, remembering that your response should fit the criteria for your service recovery trigger.

    After you have responded, you should see a follow-up service recovery ticket created in Zendesk that references your test ticket as the original ticket number.

  4. Leave a comment on the new ticket and then solve it.

    Your service recovery trigger should fire, sending you a follow-up survey. If you reply to that follow-up survey, you can open the Stream to see how the response appears.

  5. To keep your reporting data clean, remove your test feedback from the Stream when finished.

  6. If needed, work with the Agent Connect team to test your automated integration and resolve any issues that arise.

Move to production

When your integration is working as expected, move it to production via the steps below:

  1. In Zendesk, open the webhook you configured earlier.

  2. Change the Password to your Agent Connect Production API Key (available on the Integrations page in Agent Connect).

  3. In the dropdown menu at the bottom of the page, select Update, then click Submit.