Hey everyone! I'm migrating some tickets to Zendesk, and using the imports/tickets endpoint.
I have uploaded some files that go along with the tickets, but when I try to create comments on my tickets, it claims that the uploads parameter is invalid for comments. Here's a sample call:
{
"ticket": {
"external_id": "x",
"assignee_id": "x",
"created_at": "2022-11-22T18:49:21Z",
"subject": "Zendesk Merge Test Ticket: Webform 3 with attachment",
"description": "",
"priority": "",
"status": "open",
"group_id": "x",
"ticket_form_id": "x",
"brand_id": "x",
"requester_id": "x",
"tags": [
"no_verification_needed",
"other/unknown",
"other_call_back_request",
"pre-application_help",
"sms_verified_-_no_further_client_verification_needed"
],
"custom_fields": {
"request": {
"custom_fields": {
"id": x,
"value": "x"
}
}
},
"comments": [
{
"author_id": "x",
"created_at": "2022-11-22T18:49:21Z",
"body": "Original Comment."
},
{
"author_id": "x",
"created_at": "2023-01-04T15:13:54Z",
"body": "comment with 1 attachment",
"uploads": [
"zmxrhTsTvLJPmn7dVShufkoTA"
]
},
{
"author_id": "x",
"created_at": "2023-01-08T06:38:05Z",
"body": "Testing multiple files.",
"uploads": [
"6kbSPIUHaDofksZBvznJRWlK1",
"qfhDkaNCVAwPN7Nnxc1an8vFw"
]
}
]
}
}
And here is the response:
{
"error": "RecordInvalid",
"description": "Record validation errors",
"details": {
"uploads": [
{
"description": "Uploads is invalid",
"error": "InvalidValue"
}
]
}
}
Can I assume then, that I cannot attach uploads to comments as part of the import api?
If so, are there restrictions on adding comments (with uploads) to closed tickets?
If I update a ticket multiple times with {"ticket" : {"comment" : {"body":"x"},"uploads":["x":"y"], "author_id" : "x", "created_at" : date}} will it keep creating new comments?
Thanks!!
When you include attachments in the ticket comment, you first have to upload the file. We break down this two-part process in Adding ticket attachments with the API. So in your case, you'd need to download the file from the exported ticket and then upload it to the new instance to include in the imported ticket.