Run macro
Apply a macro to a ticket, as the Update menu does.
POST https://cotlet.dev/api/v1/zammad/tickets/{ticket_id}/macro/run
Applies the named macro to the ticket at once and returns the ticket afterwards. A macro can change state, priority, group and owner, add tags and notes, send a notification or run an AI agent, so what happens depends on how your admin built it. If the ticket lacks a required attribute that the macro does not set, Zammad applies none of its actions and the call returns that error. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| ticket_id integer required | integer | Ticket ID from search_tickets, list_overview_tickets or the ticket address (#ticket/zoom/{ticket_id}). |
| macro string required | string | Macro name from list_macros. |
Request
curl -X POST https://cotlet.dev/api/v1/zammad/tickets/1/macro/run \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"macro":"macro"}' result = client.call("zammad", "run_macro", {"ticket_id":1,"macro":"macro"}) const result = await cotlet.call('zammad', 'run_macro', {"ticket_id":1,"macro":"macro"}); cotlet call zammad run_macro --data '{"ticket_id":1,"macro":"macro"}' Example response
{
"ticket_id": 4830,
"macro": "Close & Tag as Spam",
"state": "closed",
"owner": "Nora Weiss",
"tags": [
"spam"
]
}