API Export of Tickets & Comments to CSV: Comment data unusable | The place for Zendesk users to come together and share
Skip to main content
Question

API Export of Tickets & Comments to CSV: Comment data unusable

  • November 3, 2023
  • 2 replies
  • 33 views

Chris46

I am using a Python script that exports (to CSV) a set of tickets using the Search API (/v2/search.json). In my script, I'm also making a call to get all ticket comments and combine into a single field (/v2/tickets/{ticket_id}/comments.json. 

For the majority of the tickets/comments, everything exports as it should and all comments combine, but it looks like that if a ticket has a quite large amount of comments, when exported to CSV, it overflows to multiple lines below the ticket and makes the ticket data unusable. I've included a screenshot (with some content hidden) to give you an idea of what is happening. I have tried getting the comments by using 'body' & 'html_body', but it doesn't make a difference. 

Any thoughts on this? Is there a limitation in how many characters can be included in Excel and/or a CSV column? 

2 replies

Chris46
  • Author
  • November 7, 2023

I believe this issue may be caused by the fact that csv files have a limit of 32,767 characters per cell. When I get back to this project, I'm going to attempt to truncate my 'comments' field being exported to CSV.


  • June 22, 2026

Did you ever find a clean CSV structure for Zendesk comments?

I’m looking into the same issue and wondering whether one-row-per-comment, JSON/XML export, or a marketplace exporter ended up working better than putting long comments into one cell.