Hi! I have noticed there are two python package APIs that seem to be referenced here:
I am not sure which is the official version, since they seem to be interchangeable. I have a basic cloud instance, and when trying to get a simple list of projects, I noticed one works, and one does not. I have created an API token via the website under the profile -> api tokens section. here is my code:
from atlassian import Jira
api_token = '<some token>'
prod_url = 'https://mysubnet.atlassian.net'
jira = Jira(
url=prod_url,
token=api_token,
cloud=True)
print(jira.projects())
print(jira.get_all_projects())
#returns [] an empty list
now if i use the other package:
from jira import JIRA
jira = JIRA(prod_url,
basic_auth=('user@domain.com', api_token))
print([x.key for x in jira.projects()])
#returns [proj_key1, proj_key2, proj_key3] as expected
with the 2nd package (jira) I get the expected response. with the first package I get an empty list. Is there something I am doing wrong with the atlassian-python-api ? This seems weird, but its my first attempt at using the python connector and am wondering what the best practices are.
Thanks-
Hi,
none of them are maintened by Atlassian, so you need to look at the github repo to look for the most up to date.
but my advice will be to use the API REST developed by Atlassian below
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.