Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only 100 results fetched if maxResults is larger than 100 #1819

Open
2 of 4 tasks
bartromgens opened this issue Feb 10, 2024 · 4 comments
Open
2 of 4 tasks

Only 100 results fetched if maxResults is larger than 100 #1819

bartromgens opened this issue Feb 10, 2024 · 4 comments
Labels
bug good first issue New contributors welcome !

Comments

@bartromgens
Copy link

bartromgens commented Feb 10, 2024

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

@sigma67
Copy link

sigma67 commented Feb 19, 2024

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)

@rynkk
Copy link
Contributor

rynkk commented Mar 1, 2024

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

@bartromgens
Copy link
Author

@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?

@ChasNelson1990
Copy link

Hi there,

Just using this package with JIRA Cloud (not self-hosted) and if I put any number greater than 100 I get a maximum of 100 (I should get 131). Using False is fine in my case but just confirm that this is an issue with version 3.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue New contributors welcome !
Projects
None yet
Development

No branches or pull requests

5 participants