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

Add new JIRA Teams API #1761

Open
Maxim-Durand opened this issue Nov 17, 2023 · 1 comment
Open

Add new JIRA Teams API #1761

Maxim-Durand opened this issue Nov 17, 2023 · 1 comment

Comments

@Maxim-Durand
Copy link

Maxim-Durand commented Nov 17, 2023

Problem trying to solve

I think it's currently not possible to fetch JIRA's team members using this client.

Possible solution(s)

Jira launched a new rest-api at https://developer.atlassian.com/platform/teams/rest/v1/api-group-teams-members-public-api/#api-group-teams-members-public-api to support this workflow.
I think it's only about adding this into the current client for a new release.

Alternatives

Instead of using https://github.com/pycontribs/jira, the user can use the REST API
For instance here is code snippet to fetch the members of a team (you'll need to fill the jira_.* variables with your own values).

from requests.auth import HTTPBasicAuth

url = f"{jira_server_url}/gateway/api/public/teams/v1/org/{jira_org_id}/teams/{jira_team_id}/members"
headers = {
    "Accept": "*/*",
    "Content-Type": "application/json"
}
payload = json.dumps({
    "first": 40
})
response = requests.request(
    "POST",
    url,
    auth=HTTPBasicAuth(jira_api_id, jira_api_token),
    data=payload,
    headers=headers
)
print(response.text)

Additional Context

No response

@Maxim-Durand
Copy link
Author

I'll try to create a PR to add this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant