pycontribs / jira

Python Jira library. Development chat available on https://matrix.to/#/#pycontribs:matrix.org
https://jira.readthedocs.io
BSD 2-Clause "Simplified" License
1.94k stars 859 forks source link

createmeta_fieldtypes does not handle pagination #1699

Open thoger opened 1 year ago

thoger commented 1 year ago

Bug summary

Responses to issue/createmeta/PROJECT/issuetypes/ID can be paginated by the Jira server. I'm seeing that for a project with more than 50 fields. In the createmeta_fieldtypes response, I see:

{'isLast': False,
 'maxResults': 50,
 'startAt': 0,
 'total': 69,
 'values': [{ ...

However, the createmeta_fieldtypes wrapper in the jira module does not seem to handle pagination at all. It does not do repeated requests in case of many fields to handle pagination transparently for the caller, nor allow passing startAt / maxResults to allow callers to handle pagination.

API reference link:

https://docs.atlassian.com/software/jira/docs/api/REST/9.10.0/#api/2/issue-getCreateIssueMetaFields

Similar problem may affect other APIs.

Is there an existing issue for this?

Jira Instance type

Jira Server or Data Center (Self-hosted)

Jira instance version

No response

jira-python version

3.5.0, but seems to be the same in main

Python Interpreter version

3.11

Which operating systems have you used?

Reproduction steps

Use createmeta_fieldtypes on a Jira project and issue type with more than 50 fields configured.  See the description above.

Stack trace

No stack trace, but incomplete data is returned.

Expected behaviour

Either handle pagination transparently for the caller, or allow passing startAt / maxResults.

Additional Context

No response

thoger commented 1 year ago

There is a PR #1626 that I failed to find previously, when I was apparently only searching in Issues, but not in Pull requests.