Python Forum

Full Version: Python Jira Connectivity
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Team,

Using Python I have established a connection with Jira and am able to extract data for specific projects,

Please confirm is there any way to extract all the columns from Jira. At present, in my code, I have explicitly called only two columns. Also, please confirm how to get the headers from Jira.
from jira import JIRA

# Establish connection to Jira
options = {
'server': 'https://your-jira-instance.atlassian.net'
}
jira = JIRA(options, basic_auth=('username', 'password'))

# Fetch issues for a specific project
issues = jira.search_issues('project=YOUR_PROJECT_KEY', maxResults=100) # Adjust maxResults as needed

# Print issue keys and their fields
for issue in issues:
print(issue.key)
for field_name in issue.raw['fields']:
field_value = issue.raw['fields'][field_name]
print(f"{field_name}: {field_value}")