Integrating JIRA with Python

I’m relatively new to Python and have been exploring its documentation. I aim to create a Python tool that retrieves issues tagged as resolved by our QA team from JIRA and generates an HTML report detailing the bug fixes for each release. However, I’m facing challenges understanding how to establish a connection between Python and JIRA. I have installed a library but encounter errors when attempting to connect. Here’s the code I’m using:

# /usr/bin/python

from jira.client import JIRA

jira_options = {'server': 'https://xxxxxxxx.atlassian.net'}

jira = JIRA(options=jira_options, basic_auth=('xxxxxxx', 'xxxxxx'))

When running this code, I receive an error message indicating issues with the session function. Could anyone help identify what might be going wrong? Additionally, I’m struggling to find useful documentation on automating tasks in JIRA. Any guidance would be greatly appreciated.

sometimes it’s simple network errors, like unstable internet or firewall settings blocking the connection. i had similar probs and switching my connection worked wonders. also try running a simple script to see if there are any general issues with your Python-env before diving back into the JIRA integration. hope it helps!

Based on what you’ve described, the issue could be related to authentication method compatibility. Atlassian recently moved from passwords to API tokens for authentication. I suggest generating an API token for your account and replacing the password placeholder in your ‘basic_auth’ tuple with this token. Also, ensure that your username is the associated email with the JIRA account. As for documentation, checking the Atlassian developer documentation and specifically looking for examples of using API tokens with Python might be helpful. Good luck with your project. It’s a powerful tool once you get it running.