In this guide, you will learn how to auto-assign an open ticket to a specific agent or group on Zendesk using Flow Builder.
Requirements
- A MessageBird account
- A WhatsApp for Business account
- A Zendesk Support account
- Set up the Zendesk x MessageBird integration
Step 1: Create an Omni-channel trigger flow
1. Go to Flow Builder and create a new flow.
2. Select Omni-channel as the trigger of your flow.
3. Link Omni-channel to your WhatsApp channel. Click the Omni-channel step. A list with all your channels will be displayed on the right side of your screen. Link Omni-channel to your WhatsApp channel — the channels that have a ✓ will be connected to Inbox.
4. Add Reply to channel message as the next step. The step form will be displayed on the right-hand side of your screen, fill in the content with the options you wish to send to your customers. Each option will refer that ticket to a different agent. For example, reply with 1 means the ticket will be routed to the stock specialist.
5. Add a Wait for a response step and a Branch step. It will look like this:
6. Add an Await webhook step under each branch. Choose contact.phoneNumber as the Identifier and add id as the variable output.
7. Add an HTTP Request step. The step form will be displayed on the right-hand side of your screen, fill in the field as follows:
- Method: PUT
- URL:
https://{subdomain}.zendesk.com/api/v2/tickets/id/tags.json
- Variable: Id — that is, the variable output from Await webhook.
- Body:
{“tags”:[“stock”]},
Stock is the tag we want to add to the Zendesk ticket. - Set Content-Type header: application/json
Need help? Check out How to add Tag into Zendesk Ticket API.
- Press Add Header, and fill in the field as follows:
- Key: Authorization
- Value: Your Zendesk API Token — check out how to set it up.
- Publish your flow in the top right corner of your screen, and you're good to go!
Step 2: Set up your Targets on Zendesk
1. Click the Admin icon () in the sidebar, then select Extensions.
2. Click the Targets tab.
3. Select Add target.
4. All of the target options are listed. Select URL target.
5. Set up your URL target. To get your URL, open your flow, click on the Await webhook step and tap copy.
Ready? Paste your URL with Id and identifier variables into the Url field. E.g. https://flows.messagebird.com/flows/invocations/webhooks/6ca726d3-9f59-4cb4-ba63-63791147c91f?id={{ticket.id}}&identifier={{ticket.requester.name}}
6. Set Method to Get and choose an Attribute Name of your preference.
7. Select Create Target from the drop-down list at the bottom of the page. If you want to test the target before adding it, select Test Target.
8. Done? Awesome! Click the Submit button.
Step 3: Set up your Awaitwebhook trigger on Zendesk
- Click the Admin icon ( ⚙️) in the sidebar, then select Business Rules, Triggers.
- Set up your trigger-Conditions as shown below:
Keep in mind that messagebird-apac is your WhatsApp business channel and 1 is the customer's reply, meaning Flow Builder will only add a tag to the ticket if the customer replies with 1.
3. Set up your trigger actions as shown below:
4. Done! Click Save to activate your trigger.
Step 4: Create a group
- Click the Admin icon ( ⚙️) in the sidebar.
- Under Manage, select People.
- Select add group.
- Enter a group name.
- Select the agents you want to add to the group.
- Click Create group.
Step 5: Set up your group trigger on Zendesk
1. Click the Admin icon () in the sidebar, then select Business Rules, Triggers.
2. Set up your trigger conditions as shown below:
Please note that Stock is the tag added by Flow Builder.
3. Set up your trigger-actions as shown below:
4. Done! Click Save to activate your trigger.
And that’s it! 🎉 Now you know how to auto-assign an open ticket to a specific agent/group on Zendesk. Check out this demo video to see them in action!