Issue for getting last public comment | Community
Skip to main content

Issue for getting last public comment

  • November 20, 2023
  • 2 replies
  • 0 views

CORENTIN

Hello, I am currently facing difficulties retrieving the latest public comment, and I have not found a solution in the documentation to identify whether a comment is public or not:

The client.get(ticket.comments) route retrieves all comments from ticket, but it does not retrieve the boolean parameter 'public' for comments.


2 replies

CORENTIN
  • Author
  • November 20, 2023

Ok my bad.


   function requestCommentsTicket(client, id) {
      var settings = {
        url: '/api/v2/tickets/' + id + '/comments',
        type:'GET',
        dataType: 'json',
      };
    
      client.request(settings).then(
        function(data) {
          console.log('request result', data)
        },
        function(response) {
          console.log('request result', response)
        }
      );
    }

  • November 20, 2023

i think you can get the channel prop from ticket.conversation to show whether is internal or web but what you have shared is definitely easier.