As I transition from the soon-to-be-deprecated "/rest/api/3/search" endpoint to the new "/rest/api/3/search/jql" endpoint, I have encountered a challenge related to pagination and its impact on performance. I am seeking advice on optimizing our approach to minimize the delay in data retrieval.
Previously, using "/rest/api/3/search", I followed this approach to efficiently retrieve all issues:
- Fetch the total number of issues.
- Calculate the number of required requests.
- Use the
startAt parameter to control pagination. - Execute multiple batch requests concurrently and resolve them together, significantly improving performance.
However, with the new "/rest/api/3/search/jql" endpoint, the response structure has changed:
{ "issues": [...], "nextPageToken": "..." }
Since startAt is no longer available, the only way to paginate is by using nextPageToken, which is dynamically generated for each request. As a result, subsequent requests must wait for the previous response to obtain the required token, preventing parallel execution and significantly slowing down the data retrieval process.
Given this limitation, we would appreciate any guidance on best practices for handling pagination efficiently with this new API. Are there any alternative approaches or optimizations that could help mitigate the impact of sequential fetching on performance?