Running a FactBranch flow when a Zendesk ticket is created

In this step-by-step guide we'll walk you through the following common use case: Whenever a ticket is created in Zendesk, you want to look up additional customer data from your database or API and want to save that data into the Zendesk user. That way, when one of your customers contacts support, their Zendesk user gets automatically updated in the background and your agents have current information to work with.

First, you need a FactBranch account. If you haven't done so, simply start your free trial today and follow this tutorial.

Then head to your list of flows in FactBranch and create a new flow. Select Use FactBranch as a webhook.

What is a webhook?

A webhook is an API endpoint, that get's called when a certain event happens. In our case FactBranch will provide you with an API endpoint that runs all nodes in that flow. Zendesk can then call this endpoint when a new ticket is created.

Connect Zendesk to FactBranch

Once you've created the webhook flow in FactBranch, your flow only consists of the trigger node.

The trigger node of a webhook flow

You can add more nodes later, but first, click on Config to open the trigger config. You'll see all the details you need to add this endpoint to an external tool. In our case this is Zendesk.

Activate Record requests to later record some real test data from Zendesk.

In your Zendesk Admin Center, click on Apps and integrations in the sidebar, then select Webhooks. Click Actions and select Create webhook.

  • Give the webhook a name - for example FactBranch: update Zendesk user.
  • Copy/paste the Endpoint URL from the trigger config page in FactBranch (there it's called POST to this URL).
  • Set Request method to POST.
  • Set Request format to JSON.
  • Select Bearer token as Authentication.
  • Copy/paste the token from the trigger config page in FactBranch.

Click Create to create the webhook in Zendesk.

Trigger the webhook when a ticket is created

We're almost done! Now let's create a trigger in Zendesk, that calls the webhook for every new ticket.

In your Zendesk Admin Center, click on Objects and rules in the sidebar, then under Business rules select Triggers. Click Add trigger.

  • Give the trigger a name - something like Trigger FactBranch on ticket creation.
  • Under Meet ALL of the following conditions click Add condition and create a condition for Ticket is created like this:

Ticket created condition in Zendesk

  • Under Actions select Notify active webhook and then select the webhook you've previously created.
  • Use the following JSON as a starting point for the JSON body. It sends ticket ID and requester email address. If you want to send a ticket's custom field here, check the list of available placeholders.
{
    "ticket_id": "{{ticket.id}}",
    "email": "{{ticket.requester.email}}"
}

Click Create to create the trigger.

Zendesk will now call the FactBranch flow when a new ticket is created. Go ahead, and either create a ticket manually or wait for a real ticket to come in. You should now see incoming data on the FactBranch trigger page.

Incoming test data in FactBranch

Next steps

You can now add more nodes to the flow. For example to look up customer data in your SQL database.

If you want to update the Zendesk user or the ticket based on those results, add a REST API node to your flow and call the relevant Zendesk API endpoint.

Want to get and keep more customers?

Sign up for our newsletter to get our freshest insights and product updates.

We care about the protection of your data. Read our Privacy Policy.