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
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/
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.