Question
Is there an automated way to add a user as a CC to a ticket?
Answer
This can be done using a webhook and a trigger:
- Create a webhook with the following details:
-
Endpoint URL:
https://yoursubdomain.zendesk.com/api/v2/tickets/{{ticket.id}}
, whereyoursubdomain
is replaced with your account subdomain
- Request method: PUT
- Authentication Basic Authentication
-
Endpoint URL:
-
If the user you wish to email already exists in Zendesk, open their user profile. Take note of the long digit in their profile URL. It will look like this:
-
https://yourdomain.zendesk.com/agent/users/361287567335/assigned_tickets
and the user ID would be:361287567335
.
-
-
Create a trigger with the following details:
-
Specify the following all conditions:
- Ticket > Comment | Is | Public
-
Ticket > Ticket | Is | Created or Ticket | Is | Updated
Add any other conditions of your choice, to match the tickets you wish to target. For example, you can add a group condition, etc.
-
Specify the following actions:
-
Notify by > Active webhook and in the JSON body, add the information below:
{
"ticket": {
"email_ccs": [
{ "user_id": "[User ID]"},
{ "user_id": "[User ID]"}
]
}
}In your JSON body, replace
[User ID]
with the ID number of the user you want to CC. Add or remove the lines below if you need to email a single user or multiple users.,
{ "user_id": "[User ID]"}
-
Notify by > Active webhook and in the JSON body, add the information below:
- Click Create trigger.
- Create a test ticket that matches your trigger conditions, to ensure the email is received. You may need to adjust your trigger conditions if necessary.
-
Specify the following all conditions:
Note: The notification will only appear from your ticket events. Add
/events
at the end of a ticket URL to view them.
Disclaimer: This article is provided for instructional purposes only. Zendesk does not support or guarantee the code. Post any issues you have in the comments section or try searching for a solution online.