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?
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.
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())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.