By default in Zendesk business rules, there's currently no way to remove CC's, Followers & Collaborators from a ticket via an automated action. We've got a handy workaround for you using a webhook and trigger combination to help you achieve this.
An example use case where this might be useful is as follows:
You have an external registration web form that sends the submitted registration requests to your Zendesk via email. The system which manages your external web form also CC's, Followers & Collaborators in their email address on the incoming email which is causing an email loop between their system and your Zendesk.
In this case, you'd like to automatically remove the CC's, Followers & Collaborators from these tickets in order to prevent the email loop from occurring.
We're going to build the webhook for the above example with you below.
Before you start:
We'll need a way of identifying the user(s) on whom we want CC's, Followers & Collaborators to be auto-removed from their tickets. We can do this one of 2 ways explained below:
- Adding a tag to the user profile
- Creating a specific Organisation & linking multiple users to the organisation
- Any user linked to the org will automatically have CC's, Followers & Collaborators removed from their tickets.
In today's example, we're going to be using option 2 - Creating an Organisation & linking the user to it.
Example:
Organisation Name: Remove all ticket CC's
User linked: robynbanks117@gmail.com
Let's dive into configuring the rest of this workflow from here below.
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.
- Select "Trigger or automation" as the preferred connection method and click Next.
- Configure the webhook with the details below.
- Click Create webhook.
Name: Update ticket
Endpoint URL: https://subdomain.zendesk.com/api/v2/tickets/{{ticket.id}}.json
Request method: PUT
Request Format: JSON
Authentication: Basic authentication
Note:
- You can either do one of the following in regard to credentials used for webhooks:
- Set up a separate automation licensed agent
- Use existing licensed administrator credentials.
- Whichever you decide to use in point 1 above, this user will appear in the ticket and its events as the agent posting the internal comment.
- You can use a standard admins login email address and password for authentication
- Alternatively for a safer method can use an API token as the password for basic authentication with the format below. Follow the steps in the Zendesk help centre article on Generating a new API token here.
- Username: janedoe@example.com/token
- Password: API token
This is what your webhook should look like below:
Connect the webhook to a trigger:
Once you've created your new webhook, you'll next create a trigger to connect it to so the CC's can be removed from the ticket automatically 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.
- Under the Meet ALL Conditions section add the 2 noted conditions below.
- 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.
Name: Remove all CC's from targeted tickets
Meet ALL Conditions:
- Ticket is Created
- Organisation is "Remove all ticket CC's"
Actions:
- Notify active webhook = Update ticket
- Add tags = "all_ccs_removed"
- JSON body =
{
"ticket": {
"follower_ids": [],
"email_cc_ids": [],
"collaborator_ids": []
}
}
OPTIONAL:
You're welcome to use the following JSON code if you would like to modify this workflow.
Remove CC's only:
{
"ticket": {
"email_cc_ids": []
}
}
Remove Follower's only:
{
"ticket": {
"follower_ids": []
}
}
Remove Contributors only:
{
"ticket": {
"collaborator_ids": []
}
}