We figured out a way to add CCs to a ticket based on conditions defined in a trigger. First, you need to set up a webhook with the endpoint
https://<company-name>.zendesk.com/api/v2/tickets/{{ticket.id}}.json
as JSON/PUT request.
Then, you can define a trigger with your conditions that calls the webhook ("Update active webhook") and sends the following JSON data:
{
"ticket": {
"email_ccs": [
{ "user_id": "123456789", "action": "put" },
{ "user_id": "987654321", "action": "put" }
]
}
}
You can use the Zendesk API to query the appropriate user IDs.
You may also configure another webhook to put a comment into the ticket notifying your agents about the change:
{
"ticket": {
"comment": {
"body": "new CCs added",
"public": false
}
}
}
Please note that the trigger should probably not act on "Ticket is updated" because that might cause an infinite loop with the new comment that also updates the ticket.
Cheers,
Matthias