Skip to content

How to Fix Jira REST API Pagination Issues

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix Jira REST API Pagination Issues. We cover key concepts, practical examples, and best practices.

Jira REST API paginates results to avoid overwhelming the server. When your API call returns truncated results, the maxResults parameter is too low, the startAt offset is miscalculated for subsequent pages, or the total count in the response is misinterpreted.

The Problem

You call GET /rest/api/3/search?jql=project=PROJ and get 50 results. You know the project has 200+ issues. The total field in the response says 200 but you only see the first 50.

Wrong approach — requesting all results with a very high maxResults.

The Fix

Use proper pagination in every API call:

GET /rest/api/3/search?jql=project=PROJ&startAt=0&maxResults=100

Read the response headers and body:

{
  "startAt": 0,
  "maxResults": 100,
  "total": 350,
  "issues": [...]
}

For the next page, increment startAt by maxResults:

GET /rest/api/3/search?jql=project=PROJ&startAt=100&maxResults=100
GET /rest/api/3/search?jql=project=PROJ&startAt=200&maxResults=100
GET /rest/api/3/search?jql=project=PROJ&startAt=300&maxResults=100

Use a loop in your code:

startAt = 0
maxResults = 100
do {
  response = jiraApi.get('/search', { jql, startAt, maxResults })
  process(response.issues)
  startAt += maxResults
} while (startAt < response.total)

Expected output:

API returns all matching issues across pages
Each page has the correct offset and count
No duplicate or missing issues between pages

Prevention Tips

  • Always check total in the response to know how many pages to fetch
  • Use maxResults=100 for optimal performance (Jira default is 50)
  • Implement pagination with a loop — do not hard-code page counts
  • Handle the case where the number of results changes between page requests
  • Use the fields parameter to request only the fields you need, reducing payload size

Common Mistakes with rest api pagination

  1. Overlapping type class instances that cause GHC to reject the program with ambiguous dispatch errors
  2. Non-exhaustive pattern matches that compile with warnings then crash at runtime
  3. Misunderstanding that String is [Char] with poor performance for large text operations

These mistakes appear frequently in real-world JIRA code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### What is the maximum page size for Jira REST API?

The maximum maxResults is 100 for most Jira Cloud endpoints and 200 for Jira Server/Data Center. Values higher than the maximum are silently reduced. If you need more results, paginate through multiple requests.

How do I know the total number of results without fetching all pages?

The total field in the JSON response gives the complete count of matching results, even if only a subset is returned in the current page. Use this value to determine how many pages you need to fetch.

Why do I get inconsistent totals between paginated requests?

Issues are being created or modified while you paginate. The total changes between requests. Consider using maxResults larger (up to 100) to reach the end faster, or build a system that handles changing totals gracefully.

Related: DodaTech's Jira API Client Library handles pagination automatically with async iteration, rate limiting, and retry logic for reliable large-scale data extraction. Use with DodaZIP for data archival.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro