Forums

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

Why is /rest/api/3/search/jql only returning 100 issues when using fields in the query ?

Adam Bang
Contributor
February 5, 2025

I am calling the API from a python script.

 

The following query only returns 100 results

query = {
'jql': 'project = MA',
'fields': ['key','statuscategorychangedate','project','created','customfield_10020','summary','assignee','updated','status','duedate','issuetype','customfield_10016', 'parent', 'team'],
'maxResults': '5000'
}

try:
# Fetch data from the API
response = utils.get_json_from_api("/rest/api/3/search/jql", query)

Whereas removing fields, increases the result to 411. In fact any fields other than just keys, limits the result to 100 issues returned.

How does fields limit the results set?

 

To complete the code I am adding the get_json_from_api function.

 

def post_json_to_api(endpoint, payload):
response = requests.post(
url=connection_info['base_url'] + endpoint,
headers={
"Content-Type": "application/json",
"Accept": "application/json"
},
auth=HTTPBasicAuth(
connection_info['username'],
connection_info['api_token']
),
data=json.dumps(payload)
)
if response.status_code == 201:
print(f"Posted successfully.")
else:
print(f"Failed to Post: {response.status_code}")
print(response.json())

API link

Similar question

2 answers

1 accepted

1 vote
Answer accepted
Mathias Richter
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 5, 2025

Hi @Adam Bang - this behavior is intended. See: https://confluence.atlassian.com/jirakb/changing-maxresults-parameter-for-jira-rest-api-779160706.html

Please utilize pagination, but also consider the Rate Limiting (Error 429): https://developer.atlassian.com/cloud/jira/platform/rate-limiting/

0 votes
Adam Bang
Contributor
February 5, 2025

Assuming I can't fix the limit. My way forward will be to use pagination, until the number of issues returned on a page is less than 100.

Suggest an answer

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

Atlassian Community Events