Automatic workflows in Zendesk can save a lot of time and agent effort. At present Zendesk business rules, do not allow for a way to automatically add a public reply to the customer automatically via an automated action. We've got a handy workaround for you using a webhook and trigger combination to achieve this.
An example use case where this might be useful is as follows:
You have an old support address connected to Zendesk that you're looking to decommission and eventually remove from the account. You'd like to be able to automatically send a reply back to the customer on the ticket to let them know this email address is no longer in service and where to redirect their request from here. At this point, you would also like the ticket to be automatically solved.
In our example here today, we're going to be decomissioning our old Dev Support email address - devsupport@con-scx.zendesk.com.
Creating the webhook:
- In Admin Center, click the Apps and integrations icon () in the sidebar, then select Webhooks > Webhooks.
- Click Actions and select Create webhook.
Endpoint URL: https://subdomain.zendesk.com/api/v2/tickets/{{ticket.id}}.json
Request method: PUT
Request Format: JSON
Authentication: Basic authentication
Note:
- You'll need to set up a separate automation licensed agent or use existing licensed administrator credentials. Whichever you decide to use, this user will show up in the ticket as the agent posting the internal comment.
- You can use an API token as the password for basic authentication with the format below. Follow the steps on the Zendesk help centre article on Generating a new API token here.
- Username: janedoe@example.com/token
- Password: API token
Connect the webhook to a trigger:
You will need to connect your newly created webhook to a trigger so the internal note can then be posted to tickets based on the conditions set.
- In Admin Center, click the Objects and rules icon () in the sidebar, then select Business rules > Triggers.
- Create a new trigger or edit an existing one by hovering over the options icon () and clicking Edit.
- For triggers, under Actions, click Add action. Select Notify webhook and then select your webhook. Click Save after you have filled out all of the trigger settings.
Meet ALL Conditions:
- Ticket is Created
- Received at is devsupport@con-scx.zendesk.com
Actions:
- Notify active webhook = Update tickets
- Add tags = "customer_notified_of_email_decomission"
- Status = Solved
- JSON body =
{
"ticket":{
"comment":{"body": "Hi {{ticket.requester.first_name}},\n\nThank you for getting in touch. We have made some changes to our support platform and the email address you have used is no longer valid, the enquiry was unable to be processed. Please head over to our new portal and resubmit your request via our new ticket forms here: **www.help.successcx.com** so we can assist you right away.\n\nMany thanks,\n\nSuccessCX Support",
"author_id": 1186499129,
"public": true,
"updated_stamp": "{{ticket.updated_at_with_timestamp}}",
"safe_update": true
}
}
}
Note: You will need to update the 'body' & author ID. The author ID is a Zendesk Agent user ID
End result: