atlassian-api / atlassian-python-api

Atlassian Python REST API wrapper
https://atlassian-python-api.readthedocs.io
Apache License 2.0
1.29k stars 643 forks source link

[Jira Cloud] Get all projects methods rely on a deprecated endpoint #1268

Open marinone94 opened 8 months ago

marinone94 commented 8 months ago

Jira Cloud "Get all projects" methods are based on a deprecated endpoint (GET /rest/api/2/project).

Therefore, for Jira Cloud "Get all projects" methods, an endpoint migration is required. I could work on it, but I would like feedback from the maintainers first.

gonchik commented 8 months ago

@marinone94 sure, please do it. I appreciate for your help!

only one thing for on-prem Jira DC and dying Server, we need to have /rest/api/2/project.

could you think about that please

marinone94 commented 8 months ago

Sure, I will consider that.

marinone94 commented 8 months ago

@gonchik I see in CONTRIBUTING.rst that Jira Cloud is supposedly built on v3: https://developer.atlassian.com/cloud/jira/platform/rest/v3/

However, in the whole jira.py method v3 is never mentioned in any docstring, nor does it seem the methods follow it. Should I add in the CONTRIBUTING file which parts use v3 and which don't?

Also, how would you like to handle when people use v2 when they are supposed to use v3? For example, when you fetch the project with the deprecated endpoint, you will get an empty response and not an error from the API. I suggest raising an Exception in the client. Do you agree?

marinone94 commented 8 months ago

Edit: there is a not-deprecated way in v2. I used that instead in the PR

ebaschiera commented 5 months ago

Hi @marinone94 , I am not a Python expert, but I found that the code in this PR is not working as expected for large project lists... would you mind taking a look at my issue? https://github.com/atlassian-api/atlassian-python-api/issues/1310

Thanks!