By default in Zendesk business rules, there's currently no way to add an internal note to a ticket from 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:
A specific customer organisation has been suspended due to non-payment and the admins would like to instruct the agents too:
- Not action further enquiries
- Redirect the ticket request from this organisation to the finance group.
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: emailaddress/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
- Organisation is XXX
Actions:
- Notify active webhook = Webook Name
- JSON body =
{ "ticket":
{"comment":
{ "body": "*****THIS IS A SUSPENDED ACCOUNT*****\n\nPlease do not action the request from the customer and redirect the ticket to Finance immediately",
"author_id": 374184768734,
"public": false,
"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
- Add tags = "suspended_account_redirect_to_finance"