Hey,
I am trying to query Jira (cloud) using API.
I generated an api-key and ran a quick python script as suggested in several places, such as:
https://stackoverflow.com/questions/12098333/querying-jira-with-python-and-rest
(I also found very similar code snippets here on Atlassian community).
However, I keep getting the same error message:
JIRAError: JiraError HTTP 401 url: https://<myurl>.atlassian.net/rest/api/2/serverInfotext: Basic authentication with passwords is deprecated. For more information, see: https://confluence.atlassian.com/cloud/deprecation-of-basic-authentication-with-passwords-for-jira-and-confluence-apis-972355348.html
So - the API is failing, and it points me to a deprecation link (though I noticed that it points there even with random erroneous input, so it might not be specific to my bug).
Any idea what I'm doing wrong? My code is provided as well, however it's basically copy paste from stack overflow:
from jira import JIRAapikey="mykey"user = 'me@comp'server = 'https://<comp>.atlassian.net'options = {'server': server}jira = JIRA(options, basic_auth=(user,apikey) )
Hi @Iddo Weiner ,
I think you are in the right path, I've seen some issues in previous questions that the APIKEY was not copied correctly and generated this error.
Can you generate a new API Key and re-test it ?
https://confluence.atlassian.com/cloud/api-tokens-938839638.html
Hey @Italo Qualisoni [e-Core] , thanks for answering.
I created a new APIkey, copied it carefully to my code snippet (made sure by eye that it was copied correctly) and ran it again.
I got the same result
Maybe I am missing a step? Is there supposed to be an earlier step where I enable API access to the account or something like that?
After you create a new API Key you should be good to use the API using it.
You can check if you are using the correct email as your user variable in your script? Your email is the last item in this page:
https://id.atlassian.com/manage-profile/profile-and-visibility
hmmm I am using the correct email..
It looks like you're new here. Sign in or register to get started.