How to extract end_user comments on a ticket distinct from agent comments


  • Greg Katechis
    Zendesk Developer Advocacy

    Hi there! Since Zenpy is a third-party library, we don't have a lot of insight into it. I was taking a look at the documentation and didn't see anything super helpful, but figured I'd link it here just in case. Hopefully someone in the community has some experience with Zenpy and can help out!

  • Ahmed Zaid
    User Group Leader Community Moderator

    Hi Reservations,

    This Zenpy snippet prints ticket comments from end users:

        ticket_id = 123
      comments =
      for comment in comments:
          author = zenpy_client.users(id=comment.author_id)
          if author.role == "end-user":

    You can probably optimise it by using incremental ticket export where I believe both comments and users can be sideloaded, hence, saving on the api calls, but at least this should get you started.


Please sign in to leave a comment.

Powered by Zendesk