Recent searches
No recent searches
Using Created and Updated Date for Tickets API
Answered
Posted Aug 19, 2022
I'm importing some tickets from a legacy ticketing system and I'm trying to pass in the original created and updated dates on the imported tickets. Also, I'm running a Python script to do the import, pulling from an Excel document. The Created and Updated dates are stored as such below in Excel.
I pull these into my Python script and convert to a string for both 'created_at' and 'updated_at' in my API call, but it's putting in today's date/time for both values by default instead of the values from my spreadsheet.
Any thoughts here? It's probably a conversion that needs to take place, but I can't figure it out.
0
6
6 comments
Serge BERTAINA DUBOIS
Hi Chris!
The json date format for Zendesk APIs is:
YYY-MM-DDTHH-mm-ssZ
like:
"created_at":"2022-06-16T13:36:05Z"
You will therefore have to reformat your date in the json.
Friendships,
Serge.
0
Chris Green
Thoughts on the syntax/format to do that?
0
Serge BERTAINA DUBOIS
Here is an example of python code to format the date correctly:
At the beginning of the python code:
Durring the code :
Then in json :
friendships,
Serge.
0
Chris Green
Thanks that helped, but I'm wondering if 'created_at' and 'updated_at' are even supported for creating new tickets via the Ticket API? I have my formatting correct (see below), but it continues to set each date within the ticket to today's date/time.
0
Serge BERTAINA DUBOIS
Indeed, these fields may be read-only.
Maybe you can create custom fields in date format to inject this information.
Friendships,
Serge.
0
Sam Livingstone
Hello Chris Green and Serge BERTAINA DUBOIS
For creating legacy tickets, please use the Ticket Import API which would allow you to set the created_at date for the legacy tickets.
POST /api/v2/imports/tickets
- This endpoint is used to create tickets with created_at date.Please review the documentation I have linked above if you have any questions. Thanks.
0