# Zendesk Integration

[<mark style="color:blue;">Zendesk</mark>](https://www.zendesk.com/) makes customer service better. Zendesk is built to meet customer needs, set teams up for success, and keep the business in sync.

Route detailed ticket alerts from Zendesk to the right users in Squadcast.

### How to integrate Zendesk with Squadcast

#### In Squadcast: Using Zendesk as an Alert Source

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4fbd74e7ca0b30173c47a1d58ed6a0804a0465aa%2FAlert_Sources.png?alt=media\&token=aaca6610-9d18-4dd4-9cf5-320042f326f1)

2\. Select **Zendesk.** Copy the displayed **Webhook URL** to [configure](#in-zendesk-create-a-squadcast-webhook-alert) it within **Zendesk.** Finish by clicking **Add Alert Source** -> **Done.**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-60cebd42b12e4ce19fd06ca54255b973a1bbf531%2FZendesk.png?alt=media)

{% hint style="warning" %}
**Important:**

When an alert source turns Active, it’ll show up under Configured Alert Sources, you can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source. An Alert Source is active if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

#### In Zendesk: Create a Squadcast webhook alert

**(1)** In the app, click the **Zendesk Products** icon in the top bar, and then click on **Admin Center**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-09814a30f947b29a3950b6d8dbec037eadc9fd63%2Fzendesk_2.png?alt=media)

**(2)** Click on **Integration settings**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-18fb8f4f77e1dddfc77eb0955a001c8ca261ad83%2Fzendesk_3.png?alt=media)

**(3)** Click on **Webhooks**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-b56f877d209599fbd1a38c20a82f475e4077b580%2Fzendesk_4.png?alt=media)

**(4)** Click on **Actions** and then, select **Create webhook**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-ed3500b816ad6e559345c5a7bcbe749ae99da051%2Fzendesk_5.png?alt=media)

**(5)** Fill in the details as indicated below

* Provide any **Name**
* **Endpoint URL**: Paste the previously copied Squadcast webhook here
* **Request method**: `POST`
* **Request format**: `JSON`

Then, click on **Create**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-13bae1f9655f6599aa5b94dc1d55e9453f286fd2%2Fzendesk_6.png?alt=media)

{% hint style="info" %}
**Testing the configured Squadcast Webhook:**

**(a)** Click on **Test webhook**

**(b)** From the drop-down for **Test event source**, select **Custom test**

**(c)** In the placeholder for **Request JSON Body**, add the following `JSON template`:

```json
{
    "ticket_id": 35436,
    "ticket_title": "This is a test incident for Zendesk",
    "ticket_priority": "low",
    "ticket_status": "Open",
    "ticket_description": "---\n\nCurrent Date and Time\n\nHello user, the integration is working as expected!!!"
}
```

**(d)** Click on **Send test** to generate this test alert

Back in Squadcast, you will now be able to see a test incident created for this test alert, thus concluding that the integration is working as expected.

<img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-d016cfeb4147de1d7eec8087078dc0bf691166a7%2Fzendesk_13.png?alt=media" alt="" data-size="original">
{% endhint %}

**(6)** In the Zendesk Support interface, click on the **Admin** icon in the sidebar, then select **Business Rules > Triggers**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4b0d0c2a6e140b9b599b648bfeb6f1028796e7cf%2Fzendesk_7.png?alt=media\&token=bf309264-8776-4ebc-bdf2-ddcf25f715e6)

**(7)** [Create a new trigger](https://support.zendesk.com/hc/en-us/articles/203662106) by clicking on **Add trigger**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-c837296d60a4bfda8f8fef1967aae79abb9a5dc6%2Fzendesk_8.png?alt=media)

**(8)** Fill form as shown in screenshot (you can put your own checks):

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-3292cd50ca12f9da3b78821e7caa408dbe55cdaa%2Fzendesk_09.png?alt=media\&token=792c2b08-4629-4165-8e4a-5f53e88c74ec)

**(9)** Under **Actions**, click on **Add action**. Select **Notify active webhook** and then select your webhook and paste the below json in the placeholder for **JSON body**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-093b92229c0e1bce652df57c59a2908a18a79fe5%2Fzendesk_10.png?alt=media)

```json
{
    "ticket_account": "{{ticket.account}}",
    "ticket_assignee_name": "{{ticket.assignee.name}}",
    "ticket_current_holiday_name": "{{ticket.current_holiday_name}}",
    "ticket_description": "{{ticket.description}}",
    "ticket_due_date": "{{ticket.due_date}}",
    "ticket_due_date_with_timestamp": "{{ticket.due_date_with_timestamp}}",
    "ticket_group_name": "{{ticket.group.name}}",
    "ticket_id": "{{ticket.id}}",
    "ticket_in_business_hours": "{{ticket.in_business_hours}}",
    "ticket_link": "{{ticket.link}}",
    "ticket_organization_name": "{{ticket.organization.name}}",
    "ticket_priority": "{{ticket.priority}}",
    "ticket_requester_name": "{{ticket.requester.name}}",
    "ticket_status": "{{ticket.status}}",
    "ticket_tags": "{{ticket.tags}}",
    "ticket_via": "{{ticket.via}}",
    "ticket_ticket_type": "{{ticket.ticket_type}}",
    "ticket_title": "{{ticket.title}}",
    "agent_name": "{{agent.name}}",
    "agent_role": "{{agent.role}}",
    "agent_email": "{{agent.email}}",
    "agent_phone": "{{agent.phone}}",
    "agent_time_zone": "{{agent.time_zone}}",
    "user_name": "{{user.name}}",
    "user_email": "{{user.email}}",
    "user_role": "{{user.role}}",
    "user_phone": "{{user.phone}}",
    "user_time_zone": "{{user.time_zone}}"
}
```

Find more details on *Rule Creation* [here](https://support.zendesk.com/hc/en-us/articles/1260803996569-Creating-a-webhook).

**(10)** Next, to create the alert, follow the steps below:

**(a)** Click on **Add > Ticket** or,

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-8fe6a553c5d46b85a50436e82e6dd0b3f68489da%2Fzendesk_11.png?alt=media)

**(b)** Fill in the fields as shown below:

* status **New -> to trigger incident at Squadcast**
* status **Open -> to trigger incident at Squadcast**
* status **Solved -> to resolve incident at Squadcast**
* status **Closed -> to resolve incident at Squadcast**

Then, click on **Create**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-e0045d52c72b928da978d0ceb863d15bfa63d1b1%2Fzendesk_12.png?alt=media)

That is it, you are now good to go! Whenever a ticket is created with `New` or `Open` status, an incident will be created in Squadcast for it. When the ticket is either `Solved` or `Closed` in Zendesk, the corresponding incident will automatically get resolved in Squadcast as well.

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*
