How do I add a comment to a ticket via API?

Return to top

18 Comments

  • Chris Green

    Madison Hoffman - I am using the Tickets API to import tickets from a legacy ticketing system. I can successfully import and create all tickets, but then I'd like to import Notes/comments for the tickets. I'm trying to use the Tickets API using a PUT (see below), but no luck. 

     

    0
  • Dave Dyson
    Hi Chris,
     
    You'll want to use the Ticket Bulk Import API endpoint for this, which will allow you to add comments and set the comment dates as part of the API call -- see Ticket Import in our API docs for more details.
    0
  • Chris Green

    @... - perfect, thank you! Works like a charm!

    0
  • Dave Dyson
    Glad to help, Chris!
    0
  • Vaibhav Agarwal (Vibs)

    @...

    I'm stuck at this issue from quite some time. Pl help!

    I'm unable to create a public comment when I specify property author_id. When I specify `author_id` then only private ticket is created. if I'm remove `author_id` property completly then the comment is being posted from the user name from which I created bearer token (i.e admin). 

    Detailed screenshots are given https://support.zendesk.com/hc/en-us/community/posts/4930070400794-Unable-to-create-a-public-comment-in-a-zendesk-ticket-with-specified-author-id

    0
  • Christopher Kennedy
    Zendesk Developer Advocacy
    Hey Vaibhav,
     
    Double check the author's role permissions.  The agent may not have permission to add a public comment to the ticket.  This is also expected behavior if the author is a light agent.
    0
  • Vaibhav Agarwal (Vibs)

    Thanks Christopher Kennedy it was really helpful. However rather than absorbing this error ideally zendesk should raise exception as `true` property is not allowed for lite-agents. 

    0
  • BI CX

    Hi!

    i'm trying to update a ticket with a public commentary with this:

    {
        "ticket": {
            "comment": {
                "body": "Oi, tudo bem?\nSou do time de Atendimento de Contestações da Kovi e estamos aqui para dar seguimento referente à sua dúvida de contestação em andamento conosco.\nPodemos prosseguir por aqui?",
                "public": true
            }
        }
    }

    It's working if i send it by e-mail channel, but it didn't work with Messaging channel. How can i update a message's ticket with a public commentary?

    Thanks!

    2
  • Dane
    Zendesk Engineering
    Hi BI CX,
     
    It seems that you have already submitted for this concern. Please continue to work with our Support Team regarding this matter. 
     
    Cheers!
    0
  • John

    Hello experts! I have a ShipStation API to pull order info. In the response I had to add the extremely long USPS URL with the orderID variable. It pulls the tracking number but with all the url info. Is it possible to just have the tracking number only displayed as a hyperlink?

    Thank you!

    0
  • Dane
    Zendesk Engineering
    Hi John,

    The update endpoint will just use whatever value is in the payload from ShipStation API. Due to this, it's not directly possible. 
    0
  • RAHUL SIDDU

    hi ,
    how to tag or mention someone in internal comments of a ticket,while making a comment through api?
    thanks 

    1
  • Noly Maron Unson
    Zendesk Customer Care

    Hi Rahul,

    The agent then needs to manually select which agent they wish to use from the @mention auto-complete menu. I'm afraid it currently isn't possible to use this feature within API. I feel like this would be good to point out to our developers in our Product Feedback forums as a feature request that you would like to see in the future!

    Hope this helps.

    0
  • Srinivas Gundeti

    ticket created in zendesk with normal body, after ticket creation I am updating same ticket with html body, some data is erased from ticket. like address information. please can some one help. this is my java code. 

    StringBuffer downMsgHtml = new StringBuffer();

    Comment commentHtml = new Comment();

    if (siteDownList != null && siteDownList.size() > 0) {

    OutageHistoryTicketsTable(downMsgHtml, siteDownList.get(0), urlMap);

    if (downMsgHtml != null && downMsgHtml.length() > 0) {

    commentHtml.setHtmlBody(downMsgHtml.toString());

    commentHtml.setPublic(false);

    createdTicket.setComment(commentHtml);

    zd.updateTicket(createdTicket);

    }

    }

     

    0
  • Juanma Giannini

    Hi. I'm interested in knowing how to make this work on messaging channels:

     

    I'm trying to update a ticket with a public commentary with this:

    {
        "ticket": {
            "comment": {
                "body": "Oi, tudo bem?\nSou do time de Atendimento de Contestações da Kovi e estamos aqui para dar seguimento referente à sua dúvida de contestação em andamento conosco.\nPodemos prosseguir por aqui?",
                "public": true
            }
        }
    }

    It's working if i send it by e-mail channel, but it didn't work with Messaging channel. How can i update a message's ticket with a public commentary?

    I'm experiencing the same issue. 

    0
  • Noly Maron Unson
    Zendesk Customer Care

    Hi Juanma,

    You're correct that the Ticket update API will work for email channel but not for messaging. You will need to have Sunshine Conversation and leverage the Sunshine Conversation API

    Hope this helps.

     

    1
  • Juanma Giannini

    Hi Noly! Thank you. Could you elaborate? I think we have Sunco integrated, but I'm not sure. And what would leverage Sunco Api mean? Thanks!

    0
  • Paolo
    Zendesk Engineering
    Hi Juanma,
     
    Sunshine Conversation API is the API used for Messaging conversations. This has a different subscription and to better understand this, please refer to this link and proceed with the Free Trial. If you have an Account Executive, you may reach out to them as well.
     
    Best,
    Paolo | Technical Support Engineer | Zendesk
    0

Please sign in to leave a comment.

Powered by Zendesk