Hi, we have migrated from server->cloud. I had python and vba happily interacting with the APIs but just can't get python to work with the cloud.
I can code it to work successfully with VBA, so I know my coding is good but for some reason python just won't work.
There's no response message, python just errors saying it has reached the max retries and didn't get a response.
I've had the network guys monitor and they say there is a 502 error (Bad Gateway I assume).
I've reverted to just doing a basic python script to query a single issue, but to no avail.
Has anyone got any ideas?
This is the python code structure per the JIRA API docs:
# This code sample uses the 'requests' library:
# http://docs.python-requests.org
import requests from requests.auth
import HTTPBasicAuth
import json
url = "https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}"
auth = HTTPBasicAuth("email@example.com", "<api_token>")
headers = { "Accept": "application/json" }
response = requests.request( "GET", url, headers=headers, auth=auth ) print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
I've tired adding in "verify: False" but also no joy.
In VBA, I did have to make one additional change over the code that I had working with jira server and that was to add a header to set the user-agent which I have also tried in python but it didn't work.
Has anyone got any ideas please?
Odd that. Any reason not to use the most common Python library to do all this?
Yep, the on-prem code is actually using that but reverted to the JIRA API doc python example to rule out any issues.
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.