Hi, the following code is not working for me. I returns an object, but then I cannot query the fields of hte object, or the object is the wrong object type. Any suggestions would be appreciated. Environment : Anaconda Python, JIRA Cloud.
from jira.client import JIRA
import traceback
print("Start")
issue=None
def tryJIRAConnect(issue):
jira_options = {'server': 'https://l8c.atlassian.net'}
try:
jira = JIRA(options=jira_options, basic_auth=('xxx.xxx@xxx.com', 'xxxxxxxxxx'))
issue=jira.issue('xxxDEV-1')
print(f'Success : JIRA Issue is : {issue}')
return(issue)
except Exception as e:
print(e)
traceback.print_exc()
x = tryJIRAConnect(issue)
print(f'x is : {type(x)}')
try:
print(x.raw)
except Exception as e:
print(e)
traceback.print_exc()
Wa expecting the issue details in this object,looks like the server connectionto me.
'baseUrl': 'https://xxx.atlassian.net', 'version': '1001.0.0-SNAPSHOT', 'versionNumbers': [1001, 0, 0], 'deploymentType': 'Cloud', 'buildNumber': 100187, 'buildDate': '2022-01-05T14:01:29.000+0100', 'serverTime': '2022-01-08T12:33:41.914+0100', 'scmInfo': '07b4f58ec2724461528057c7cbdf73a2f653f223', 'serverTitle': 'Jira', 'defaultLocale': {'locale': 'en_US'}}
Hi @Andrew Sear
Welcome to the community!!
How about you use this API and let me know the feedback
This one is flexible
https://atlassian-python-api.readthedocs.io/index.html
Being said that, the error might be related to Link provided is not correct, can you try with only till .net and then see if you can access the issue object
It should return all the dat related to issue that you are querying
Thanks,
Pramodh
Thanks, changing the url link certainly helped, I can now see a lot of details with the issue retrieved. I will move on to the next step :-). Thanks for the answer. I will also take a look at the API you have suggested.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also tried the api you suggested... 5 minutes later, and it returns the necessary value. Thanks for the suggestion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So the API seems good. I am testing on JIRA Cloud, but work has JIRA Server with greenhopper. Is there any way to get a sprint report from JRIA Cloud as a JSON response, similar to what can be done with JIRA Server and greenhopper? Or is this ability not availble with JRIA Cloud? If so, what would be the equivalent? For various reasons I am extracting the sprint reports to json files, then summarizing and merging the data, for display in Tableau.
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.
Thanks, I have been trying that one, stuck with authentication problem error 401. Using the same credentials that work with the jira api you reference earlier.
url = "https://xxx.atlassian.net/rest/agile/1.0/sprint/xxx_1.1"
cred = "Basic " + base64.b64encode(b'xxxx.xxxxxx@gmail.com:xxxxxxxxx').decode("utf-8")
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "cred"
}
response = requests.request(
"GET",
url,
headers=headers
)
Error message is :
{"message":"Client must be authenticated to access this resource.","status-code":401}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is the password from the same as the token used in the other API? Or is it the password I used to create the jira project?
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.