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())
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/
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.
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.