Add a comment to the ticket

2 Comentários

  • Eric Nelson
    Zendesk Developer Advocacy
    Hey Andrei,

    You'll want to use the client.request method to make an api call to accomplish this. 
     
    Hope this helps!
    0
  • Julien MCC

    You must use an API call. client.invoke or client.set both deal with the agent interface data - assignee, requester, fields values, etc but to update a ticket you must do like this :

    client.get('ticket').then(function(response) {
      let ticket = response['ticket'];
      console.log(ticket['id']);
      client.request({
        url: '/api/v2/tickets/' + ticket['id'],
        contentType: "application/json",
        type: 'PUT',
        data: JSON.stringify({
          "ticket": {
            "comment": {
              "body": "Your comment goes here",
              "public": false
            }
          }
        })
      }).then(function(response) {
        console.log(response)
      })
    });
    0

Por favor, entrar para comentar.

Powered by Zendesk