Open jstafford5380 opened 9 months ago
I agree that the way this is handled probably is not the most elegant, but maybe this workaround can alleviate the pain, while people check if this misbehaviour is worth adjusting:
Set maxResult
to "0"
instead of 0
, e.g.:
unplanned = client.search_issues(
jql_str=f'project = {project} '
f'AND type != subtask '
f'AND priority = Highest '
f'AND created >= {start} AND created >= {end}',
maxResults="0"
)
Jannik Meinecke jannik.meinecke@mercedes-benz.com on behalf of MBition GmbH.
Bug summary
The API allows for specifying fewer than 50 results, so should the SDK. For example, I want to even be able to set 0 if I just want to get the count for the query result, which currently, I cannot.
Is there an existing issue for this?
Jira Instance type
Jira Cloud (Hosted by Atlassian)
Jira instance version
cloud
jira-python version
3.6.0
Python Interpreter version
3.10.6
Which operating systems have you used?
Reproduction steps
I believe the problem is here:
https://github.com/pycontribs/jira/blob/09750538a6f10cfe38fd6d1b284bf26f11728b86/jira/client.py#L732-L735
There is a statement
if maxResults:
which evaluates to false when zero and the fo.lowing elif statement sets it to a batch size of 100. I find it strange to use an int as a boolean in this way, so I wonder if this was intended.Stack trace
In my case it was revealed during an unrelated error (notice maxResults at the end of the URL)
Expected behaviour
When I set
maxResults=0
then that is what should be sent to the server.Additional Context
No response