Need help with Atlassian Jira Python library on Data Centre

Stephen Ellwood
Contributor
February 28, 2025

I have been using the Atlassian Python api library now for a couple of years on our Cloud instance and have managed to make it work quite well.  

We are going to migrate to the Datacentre version so I have just tried the same code on there and it does not work.

I created a token and it seems to authorize me ok but whenever I use any class methods of the jira object it comes back with:

HTTPError: Unauthorized (401)

I can see the project and do the same search from my browser window.  Does anyone else have experience of using this Library on a data centre Jira instance? 

https://atlassian-python-api.readthedocs.io/jira.html#get-issues-from-jql-search-result-with-all-related-fields

1 answer

0 votes
Mirek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 28, 2025

Hi @Stephen Ellwood 

Not exactly sure what your scripts are doing but if you are able to login (authorize) and do a simple check on API then you should ok in general.. 

# Simple API call to test
user = jira.myself()
print(user)

Then you have to step by step check what line exactly is failing in the script.. 

Cloud and Data Center APIs are a little bit different so it might be a problem however if you are using some library that should work on both then we have to check if this is not some kind of bug..  

Double-check also with your Jira settings to ensure that the correct permissions is set for your user and project.

If you continue to have problem please share some more information. Everything might be useful to troubleshoot. 

Stephen Ellwood
Contributor
March 2, 2025

HI Mirek,

thanks for the quick reply.  My first code immediately did a jira search but when that failed I looked for the simplest command I could try and came up with user = jira.myself(). I also put a print statement after creation of the jira object and this proved that the open was ok.

I have asked IT to check the correct permissions are set for the project.  Are there separate permissions for me as a HTTPS browser and me as a tokenised browser?

The code I use is:

from atlassian import Jira

jira = Jira(url=instance, username=name, password=token)

print('Jira open', jira)

print(jira.myself())

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events