Trouble connecting to JIRA using Python library

Hey folks, I’m having a hard time getting the jira-python library to work with our project’s JIRA instance. Here’s what I’ve tried:

config = {
    'base_url': 'http://192.168.1.100:8080'
}
jira_client = JiraConnection(config=config, auth=('my_user', 'my_pass'))

When I run this, I get an error saying the resource isn’t available:

Error: Resource not found - /api/v3/info
http://192.168.1.100:8080/api/v3/info

I can log in to JIRA just fine through my browser with these credentials. What am I doing wrong here? Any ideas on how to fix this?

Thanks for your help!

I encountered a similar issue when setting up Jira integration for our team. The problem might be related to the API version you’re trying to use. Jira’s API endpoints can vary depending on the version installed on your server.

Try modifying your base_url to include the REST API path explicitly:

config = {
‘base_url’: ‘http://192.168.1.100:8080/rest/api/2
}

Also, ensure you’re using the correct authentication method. If your Jira instance uses basic auth, you might need to import and use the ‘Basic’ auth handler:

from jira import JIRA
jira = JIRA(config[‘base_url’], basic_auth=(‘my_user’, ‘my_pass’))

If these don’t work, check with your Jira admin about the correct API version and authentication method for your specific setup. Good luck!

hey mate, had the same headache last week. turns out our IT guys changed the api version. try using ‘/rest/api/latest’ instead of ‘/api/v3’ in ur base_url. also, double check ur network settings - sometimes VPN can mess things up. let me kno if that helps!

I’ve been down this road before, and it can be frustrating. One thing that hasn’t been mentioned yet is SSL certification. If your Jira instance is using HTTPS, you might need to verify the SSL cert.

Try updating your config like this:

config = {
‘base_url’: ‘https://192.168.1.100:8080’,
‘verify’: False
}

The ‘verify’: False part tells the library to skip SSL verification. It’s not ideal for production, but it can help diagnose if that’s the issue.

Also, check if you need to append ‘/jira’ to your base URL. Some setups require it:

‘base_url’: ‘http://192.168.1.100:8080/jira

Lastly, make sure your Jira account has the necessary permissions to use the API. Sometimes browser access doesn’t guarantee API access.

Hope this helps you troubleshoot further!