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.
Hi Adam
I have the same issue. If you were able to fix the issue with pagination? Would you be so kind to share the code?
Kind regards,
Park
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.