API call to retrieve all tickets using filter

I have 67k tickets. I need to get the nested custom fields. These are available per record in the get ticket call. The standard get is limited to 9000 tickets without any criteria.
If I use a filter on created _at > x created_at < Y I am limited to 30 per page and 10 pages (300 tickets). How do I loop through the api calls to get all tickets with this method?
Or is there another approach?

Hi Bruce McLean,
To do this I suggest you use reporting. You could create a tabular report with all the tickets and export it to csv also inserting the custom fields you need.

If you cannot generate custom reports you could search among the predefined ones for one that allows you to extract all the ticket IDs and then use a get on each ticket in the list

Could this help?

1 Like

Thank @Mattia_Pipar, I’ve managed to resolve my issue by creating a powershell script to loop through all tickets in 2 week groups, while keeping the calls below 50 per minute.

Hey @brucemclean,
what if you use the “updated_since” filter of the list all tickets endpoint?
This endpoint gives me 30K tickets (100 tickets x 300 pages), so you’d need much less calls.

Was this a one time effort, or do you need to pull all tickets again and again?

Best,
Tom

Yes, I’ve looked at that. My problem with updated_since is I’d need to guess how many records in each batch and then either remove duplicates or miss some records where there wasn’t overlap. It needs to be a repeatable process and tickets change all the time.

Ah okay - So you don’t need up to date data, you just need the tickets once as they are at the time when you fetch them?
Then the updated_since may not be the best option.