Create New Ticket With Two Comments


  • Greg Katechis
    Zendesk Developer Advocacy
    Hi Jackson! There is no way to accomplish this with one API call. You would need to create the ticket first and then update the newly created ticket with the other comment in a second call.
  • Stephen Belleau
    Community Moderator

    Jackson Atkins I don't believe this is possible 😞

    Per The Ticket Comments API has no endpoint to create comments.

    Comments are created with the Tickets API

    which only accepts comment as an object, not array.

    Some thoughts:

    1. If the purpose is to remind agent about steps for a request type, perhaps you can create the Subject with a unique keyword/string for that request type. The Subject gets automatically searched with the Knowledge Capture app, which could return articles containing steps for handling this request type. Assuming you use Guide for internal knowledge.

    2. Otherwise, perhaps create the ticket with public comment and some kind of tag or custom field to capture type of request, and then use that tag/field to trigger a webhook update, or ZIS, or a custom ticket app to perform the private comment and/or apply a macro...

  • Jackson Atkins

    Thanks for the responses. I thought this might be the case but I wanted to check and see if I missed something. Sometimes the API reference allows you to do things that are not documented. 

    What I'm planning to do then is create a custom field with the type of request. Then, I'll have a webhook fire on all new tickets. I'll read the custom field and have the bot post a private comment to the ticket based on the ticket type (basically your option 2). 

    I just wanted to make sure I couldn't handle it in one request before going through the trouble of implementing all of this.  

  • Chris Green

    Greg Katechis - I'm trying to add multiple comments to tickets through the API as well. I have first created the ticket in ZD through the API and am then trying to update the ticket to add an additional comment, but something isn't working, or maybe I just have the format of the request incorrect?

    See below:


  • Tipene Hughes
    Zendesk Developer Advocacy

    Hey Chris Green,

    You'll just need to amend the format of the request body slightly. Here's an example that will add an additional comment to the ticket:

        "ticket": {
          "comment": {
            "body": "This is an updated reply on Tuesday",
            "public": true

    Here's a link to the docs that go in to more detail:

    I hope this helps! Feel free to reach out with any questions.


  • Chris Green

    That did it, thanks Tipene Hughes


Please sign in to leave a comment.

Powered by Zendesk