Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira API for fetching 1000 records

ibm_kustagi_mercedes-benz_com
Contributor
April 16, 2025

Hi,

  I have created a filter and trying to fetch 1000 plus records. Can you please let me know how to fetch through Jira API.

 

Regards,
Suma

2 answers

2 accepted

6 votes
Answer accepted
Ollie Guan
Community Champion
April 16, 2025

Hi @ibm_kustagi_mercedes-benz_com ,

when using the REST API to fetch a large number of records, such as 1000, you may encounter limitations on the number of results returned. The maxResults parameter in your API request can be set to a desired number, but the actual number of results returned may be limited by the API endpoint's constraints to ensure performance and reliability for all users

Changing maxResults parameter for Jira Cloud REST API

https://support.atlassian.com/jira/kb/changing-maxresults-parameter-for-jira-cloud-rest-api/

0 votes
Answer accepted
Rudy Holtkamp
Community Champion
April 16, 2025

Hi @ibm_kustagi_mercedes-benz_com ,

I've you use scripting, e.g. Python you can use a function like:

def fetch_issues(jql, max_results=100):
start_at = 0
all_issues = []

while True:
url = f"{JIRA_DOMAIN}/rest/api/3/search"
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}

params = {
"jql": jql,
"startAt": start_at,
"maxResults": max_results
}

response = requests.get(
url,
headers=headers,
params=params,
auth=HTTPBasicAuth(EMAIL, API_TOKEN)
)

if response.status_code != 200:
raise Exception(f"Failed to fetch issues: {response.status_code} {response.text}")

data = response.json()
issues = data.get("issues", [])
all_issues.extend(issues)

if start_at + max_results >= data["total"]:
break

start_at += max_results

return all_issues

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events