Adding comments via API - can you include a public and private comment?



已于 2025年4月23日 发布

I would like to update a ticket with a private note and a public reply. This can be accomplished via macro, so I'm curious if it can also be handled via the PUT  update ticket end point. Something to the effect of:

{
  "ticket": {
    "comment": {
      "body": "Did you try turning it off and back on again?",
      "public": true
    },
    "comment": {
      "body": "This customer can't keep from setting their printer on fire",
      "public": false
    }
  }
}

1

2

2 条评论

      Hi Matthew,
       
      Thank you for contacting the Zendesk Support Advocacy team. My name is Ryan and I'll be assisting you today. I understand that you want to include a public and private comment in a single API. Is this correct?If that is the case, you are unable to include both a public and a private comment in one API call using the PUT /api/v2/tickets/{id}.json endpoint in Zendesk.
       
      Why?

      Zendesk's API expects only one comment per request, and it must be provided in a single comment object. You cannot include multiple comment objects in the same payload — doing so would overwrite the earlier one (because JSON keys must be unique).
       
      If you want to post both a public reply and a private note, you need to do two separate API calls, like so:
       
      Kindly inform me if the information provided was useful.
       
      Please note, the ticket will be resolved automatically after a few days if we don't hear back from you, but you can always reply which will either reopen your ticket or create a follow-up.

      0


      Hey 1900360390924 ,

       

      For internal comments, it's now a native feature within triggers. The action is called Ticket > Internal note.

       

      For public comments, you could leverage a webhook, the action in the trigger would be Notify by > Active webhook and look like what you had outlined:

       

      {
      "ticket": {
      "comment": {
      "body": "whatever text you want here",
      "public": true
      }
      }
      }

      0


      登录以发表评论。

      找不到所需的内容?

      新建帖子