pycontribs/jira

Only 100 results fetched if `maxResults` is larger than 100

Opened this issue · 3 comments

Bug summary

Problem
When I request more than 100 max results (for example: maxResults=200) via:

 client.search_issues(jql_str=jql_str, maxResults=200)

I expect the client to batch get all pages and return me 200 results.
However, it unexpectedly limits the number of results to 100.

Is there an existing issue for this?

  • I have searched the existing issues

Jira Instance type

Jira Cloud (Hosted by Atlassian)

Jira instance version

No response

jira-python version

3.6.0

Python Interpreter version

3.8

Which operating systems have you used?

  • Linux
  • macOS
  • Windows

Reproduction steps

# some query that gives in more than 100 results
jql_str = "project = XX"

# maxResults = False
results = client.search_issues(jql_str=jql_str, maxResults=False)
print(f"results with maxResults=False: {len(results)}")

# maxResults = 200
results = client.search_issues(jql_str=jql_str, maxResults=200)
print(f"results with maxResults=200: {len(results)}")

Stack trace

results with maxResults=False: 248
results with maxResults=200: 100

Expected behaviour

I expect the client to batch get all pages and return me 200 results.
However, it unexpectedly limits the number of results to 100.

Additional Context

No response

I just tested this locally with jira 3.6.0 and our private Jira instance and I get the correct amount of results (maxResults=1000 -> 277)

With the exact same snippet I get the correct output:

results with maxResults=False: 3187
results with maxResults=200: 200

Also tested with 3.6.0. Can you give any additional information, maybe dig into where the batching code stops prematurely?


Jannik Meinecke jannik.meinecke@mercedes-benz.com on behalf of MBition GmbH.

Provider Information

@rynkk I don't see any batching code if maxResults evaluates to True. It only does batch get if maxResults is False:

if not maxResults:

Note that max_results_from_response is 100 for me (not equal to the maxResults argument of 200) in the code below:

max_results_from_response = resource.get("maxResults", 1)

Looks like it depends on the max results the server is configured to return. Maybe your (private) jira instance is configured differently than Jira cloud?