Zammad logo Zammad automation · runs weekly

Merge duplicate Zammad tickets with AI

A customer answers from a new email thread, Zammad cannot match the reference, and now one problem sits in two tickets with two owners replying to it.

Cotlet does it in your own Zammad account with search_tickets, get_ticket, list_ticket_articles, merge_tickets and add_internal_note, called by your AI agent, an n8n workflow or a script.

Hosted · nothing to install or maintain

Can Zammad do this on its own?

Zammad merges tickets by hand from the ticket sidebar, and its merge dialog lists the customer's recent tickets while a person picks the target (checked 22 Oct 2026). The ticket endpoint pages of the REST API document no merge call. Nothing finds likely duplicates for you.

How you do it in Zammad today

  1. The agent notices the second ticket, or finds it with search: s opens the search bar, and attributes such as customer.firstname and state.name narrow it down.
  2. The agent opens the duplicate and chooses Merge from the Ticket submenu in the ticket sidebar.
  3. In the dialog the agent types the number of the original ticket, or picks it from Recent customer tickets or Recently viewed tickets, and clicks submit.
  4. Zammad moves the articles into the original. The duplicate stays, with its articles replaced by a merged label, the state merged and a link to the original.
  5. Nobody sees the pair until someone opens both tickets, so duplicates tend to be answered twice first.

How to merge duplicate Zammad tickets with AI

Prompt

Find open Zammad tickets from the same customer about the same issue this week. Merge each newer duplicate into the original, and leave a note on the original. List pairs you are unsure about instead of merging them.
  1. 01

    Collect candidates

    search_tickets runs Zammad's own search with the query from your prompt, for example open tickets created this week, and the agent groups the results by customer. Only customers with two or more tickets are looked at further.

  2. 02

    Compare the pair

    get_ticket gives the customer, group, state and creation time of both tickets. Tickets in different groups, or from different customers, are not merged and go to your list.

  3. 03

    Read both threads

    list_ticket_articles returns both conversations. The agent merges only when both describe the same issue, such as the same invoice number or error message, and lists a pair that merely shares a topic.

  4. 04

    Merge into the original

    merge_tickets takes the newer ticket as source and the older, already worked one as target, the direction Zammad's own guide uses. The call waits for your OK by default, because a merge is not undone in one call.

  5. 05

    Leave a trail

    add_internal_note on the original says which ticket was merged in and why. Whoever owns the original sees it, and the customer does not.

What you get back

Example data

Open tickets this week: 31
Customers with 2 or more: 4
Merged 3:
- Invoice address change: 4821 into 4790
- VPN setup question: 4833 into 4802
Left for you 1: Leo Brandt, two different VPN errors

Other ways to ask

  • Every Friday, merge duplicates from the last 7 days and list what you merged.
  • Show me possible duplicates of ticket 4790 and merge nothing.
  • Only merge when both tickets are in the Support group and both are still open.

What Zammad allows, and what to know first

  • A Zammad merge moves all messages and notes of the duplicate into the original, so the original shows the full history afterwards.
  • The merged ticket stays in Zammad with the state merged and a link to its parent; its articles are replaced by a merged label.
  • If the two tickets came from different channels, the reply must go through the channel of the remaining target ticket, for example email after merging a chat ticket into an email ticket.
  • Deleting a ticket through the REST API needs the admin permission and cannot be undone, so Cotlet merges and never deletes a ticket.
  • Zammad shows an account only the tickets of its groups, so a merge works only between tickets that agent user can open.

merge_tickets and add_internal_note ask for your OK by default. To run it weekly without you, switch confirmation off for those tools in your dashboard.

Sources: Zammad User docs: Merge Tickets · Zammad User docs: Advanced Search · Zammad User docs: Ticket Basics · Zammad API: Tickets

Call merge_tickets from a script

curl

curl -X POST https://cotlet.dev/api/v1/zammad/source-tickets/4821/tickets/merge \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"target_ticket_id":4790}'

Example response

{
  "target_ticket_id": 4790,
  "target_number": "31004790",
  "source_ticket_id": 4821,
  "source_state": "merged"
}

MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is zammad_write → merge_tickets. Example data.

Schedule it in n8n, Make, Zapier or cron

Zammad tools this automation uses

Cotlet Zammad tools used to merge duplicate Zammad tickets with AI
Tool Parameters
search_tickets query, limit, cursor
get_ticket ticket_id
list_ticket_articles ticket_id, cursor
merge_tickets source_ticket_id, target_ticket_id
add_internal_note ticket_id, body
All 14 Zammad tools with descriptions

Frequently asked questions

Is it safe to connect Zammad to Cotlet?

Yes. You sign in to Zammad yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get Zammad once you enable it, every background request is listed, and the browser profile is stored encrypted with AES-256-GCM, the cipher 1Password uses for its vaults. The AI model never sees a login, posts and messages wait for your OK, and Disable for agents cuts access in one click. Independent scanners grade cotlet.dev A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory; live results are on https://cotlet.dev/security.

Give your agent access to Zammad.

Free 7-day trial with 2,000 credits, no card needed. Cotlet is independent and not affiliated with Zammad.