API max output with a search query

Infos:

  • Used Zammad version: 6.4.1-1738738661.5fc56520.centos9
  • Used Zammad installation type: package
  • Operating system: Oracle linux 9
  • Browser + version: any

Expected behavior:

  • I want to set up a script to export tickets closed every months to have a more precise and automated output than the built-in reporting tool
  • I want to get all the tickets closed last month and make sure those tickets are relevents, the URL API my script calls has those criteria in it and “&per_page=10000” at the end
  • So I should get all the tickets closed last month

Actual behavior:

  • The URL itself works since I get just the right tickets but I only get the first 200, from what I saw Zammad starts it’s search from the most recently closed and goes to towards the past.
  • Zammad is aware that the missing tickets exist because it shows them to me when I modify the start and end dates of the month in the URL
  • I have the same issue with simpler URLs

Steps to reproduce the behavior:

  • Exemple of URL with wich I get the issue:
  • https://{ZAMMAD_DOMAIN}/api/v1/tickets/search?query=state.name%3Aclosed&per_page=10000

You need to iterate in your script. Build a loop and iterate through the pages until the result is empty:

https://docs.zammad.org/en/latest/api/intro.html#pagination

per_page=100&page=1
per_page=100&page=2
per_page=100&page=3

Nobody will let you get gather all the data at once since it could crash the system when the memory limit is reached.

Thank you for your response !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.