Open hchienjo opened 1 year ago
What endpoint are you using? I guess that response of Ticket API doesn't have audit info. You could use Ticket Audit API instead.
https://pkg.go.dev/github.com/nukosuke/go-zendesk/zendesk#Client.GetTicketAudits
PUT
request to /api/v2/tickets/{ticketID}.json
to update a ticket, like for example adding a comment to a ticket.
audits can be retrieved only from dedicated endpoint, maybe. https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_audits/#list-audits-for-a-ticket
So, you should send another GET
request to /api/v2/tickets/{ticket_id}/audits
after updating the ticket.
In the example from zendesk documentation after updating a ticket, the response payload has an audit event. I am thinking of a case where you want to see the audit of changes done to the ticket directly related to the update you have just done.
oh, I didn't know. Thank you for the information.
Then, this method seems discard "audit"
payload as you said.
https://github.com/nukosuke/go-zendesk/blob/e68b5451c9ee694bef450ddd617013d142836985/zendesk/ticket.go#L262-L265
I am thinking of a case where you want to see the audit of changes done to the ticket directly related to the update you have just done.
To support this case, we should add new method which returns audit events.
Will you be able to work on it? I can take this up given the name that you want for the new method name?
Maybe we can call it UpdateTicketWithAudit
?
After updating a ticket, only the ticket part of the response from zendesk is parsed and the audit part is discarded. Is it possible to add it as we have encountered a use case for that?