0

Bug: Updating Ticket's comment via Lotus App's Ajax call fails

Reference:

http://developer.zendesk.com/documentation/rest_api/tickets.html#updating-tickets

Hi

I am wanting to update a ticket's comments through the Lotus App using an Ajax call by following the aforementioned reference.

  1. In providing within request data = "comment: { public: " fails JSHint

Upload Error

         JSHint error(s): L619: Expected an identifier and instead saw 'public' (a reserved word).

  1. Request: Maybe rename comment's public: to either public_reply: or internal_note: so upload will pass JSHint.

  2. In making the request (without public attribute in comment JSON body) it fails

Here is the function making the PUT request to update the ticket:

putTicketComment: function(data) {
var currentAccount = this.currentAccount();
var ticket = this.ticket();
var subdomain = currentAccount.subdomain();
var id = ticket.id();
var url = 'https://%@.zendesk.com/api/v2/tickets/%@.json'.fmt(subdomain, id)
return {
url: url,
type: 'PUT',
dataType: 'JSON',
data: data
};
}

And here is the code calling putTicketComment with defined data (notice that I commented out public: to pass JSHint at upload:

var data = {
ticket: {
status: ticket.status(),
comment: {
// public : true,
value: 'Hello, World!!!'
}
}
};
this.ajax('putTicketComment', data);

The failure response to 'putTicketComment.fail' was as follows:

Put ticket comment failed:

    jqXHR = {    status: 200,    statusText: OK,    responseText: Invalid URL parameter    },

    textStatus = parsererror

So, error is with the provided data, because my built url looks okay:

  url = https://jeff00tangocard.zendesk.com/api/v2/tickets/5.json

Thanks for your assistance,

  • Jeff

12 comments

Please sign in to leave a comment.