Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hi,
I have joined Atlassian Jira Software with Standard Plan.
I have created a project called QTIM and created an issue under that. I have created API Token as well.
I am trying to get jira instance of my issue with below python code.
jira_options = {
'server': jira_url,
'auth': (jira_email, jira_api_token)
}
try:
jira_client = JIRA(options=jira_options)
print(jira_client.user) # Example API call using the client
print("Getting issue")
# Get all projects viewable by anonymous users.
projects = jira_client.projects()
print(projects)
issue = jira_client.issue(issue_key)
print("success")
except Exception as err:
print("Error:", err)
Here I am getting projectss as empty and unable to get issue instance later.
can anyone help please
regards
Mallika
Hi @Mallika Nandikotkur
Are you trying to get issue details via python ?
You can try below python code - Ensure to replace your-domain.atlassian.net in the url parameter with your cloud site and {issueIdOrKey} with the ID or key of the issue.
import requests
from requests.auth import HTTPBasicAuth
import json
url = "https://your-domain.atlassian.net/rest/api/2/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=(",", ": ")))
Hi Kishan Sharma,
Thank you so much for quick response. THis works.
regards
Mallika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad to help, Mallika :)
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.