How to export Zendesk tickets with comments
Auditors, legal teams and analysts ask for the same thing: every ticket matching some criteria, with its comments, in a spreadsheet, and a number that matches what the account really holds. Here are the four ways to get it, with their limits.
1. Zendesk's built-in export
Admin Center → Account → Tools → Reports lets admins export tickets as CSV, XML or JSON for the whole account (the CSV has no comments; XML and JSON carry them). It is a full-account dump on a schedule, not a filtered export, and it is only available on some plans. Good for a periodic backup; not for "the 1,240 tickets tagged refund closed in Q2 with their comments".
2. Views and search
A view can be exported as CSV by e-mail, again without comments. Search in Support shows at most 1,000 results and the API's /search endpoint has the same cap, which is why many exporter apps show wrong totals on large accounts. The /search/export endpoint has no cap but is cursor-paginated and returns raw JSON; it needs code.
3. The API with a script
The reliable recipe: GET /api/v2/search/count.json for the exact count, GET /api/v2/search/export.json?filter[type]=ticket&query=… page by page, then GET /api/v2/tickets/{id}/comments.json per ticket, then resolve requester and assignee ids to names with users/show_many, then write CSV with proper quoting and a guard against spreadsheet formula injection. It works, takes an afternoon to write, and needs an API token or OAuth app that then has to be protected. Zendesk is retiring API tokens for some integrations, which pushes teams toward OAuth or apps.
4. Data Custodian
Data Custodian runs inside Zendesk Support with the admin's session, no token, no server:
- Open Search, add conditions (status, tags, dates such as "older than 365 days", custom fields, requester, free text). The count uses the export endpoint, so it is exact for the whole account.
- Click Columns to pick standard fields, custom fields, metrics (first reply and resolution time, replies, reopens) and satisfaction.
- Click Export, choose CSV, Excel (XLSX) or JSON, choose "everything that matches", tick Include comments (one row per comment, internal notes on or off, HTML or plain text).
- The file is built in your browser and saved by your browser. Names are resolved, dates are ISO, and cells starting with
=,+,-or@are neutralised so a customer-written subject cannot run as a formula in Excel.
The Free plan exports 500 rows a month; Pro and up have no limit. Every export is listed in Exports & changes with its criteria and can be run again, and appears in Audit as evidence (who exported what, when, how many rows).
Comments as rows, explained
A ticket with three comments becomes three rows. The ticket columns repeat on each row, followed by comment id, author, public or internal, created date, channel, body and attachment names with links. Pivot on the ticket id in Excel to get back to one row per ticket, or filter "Comment public = true" for customer-visible text only.
What about attachments?
Attachment files are not in the export: browsers cannot download them from inside an app without exposing the agent's session. Every attachment is listed with its name, type, size and a link that works for signed-in agents. For a data subject access request, Data Custodian's DSAR pack does the same for one person and adds a printable report.
Related: deleting Zendesk tickets for GDPR with evidence · the ADPP add-on compared · try the demo.
Support: support@helpcenterdoctor.app.