There seems to be several jira api available on python library:
1. from jira import JIRA (does not work)
2. from atlassian import Jira (work)
If I use the jira from JIRA package like following to login, it faults:
jira = JIRA(basic_auth=(\
JIRA_SERVER_AUTH_BASIC[JIRA_SERVER_PROFILE].split()[0].strip(), \
JIRA_SERVER_AUTH_BASIC[JIRA_SERVER_PROFILE].split()[1].strip()))
and I am getting following errors when trying to connect:
Using jira library
WARNING:root:HTTPConnectionPool(host='localhost', port=2990): Max retries exceeded with url: /jira/rest/api/2/serverInfo (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f4cae23c048>: Failed to establish a new connection: [Errno 111] Connection refused',)) while doing GET http://localhost:2990/jira/rest/api/2/serverInfo [{'params': None, 'headers': {'User-Agent': 'python-requests/2.21.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json,*.*;q=0.9', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json', 'X-Atlassian-Token': 'no-check'}}]
WARNING:root:Got ConnectionError [HTTPConnectionPool(host='localhost', port=2990): Max retries exceeded with url: /jira/rest/api/2/serverInfo (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f4cae23c048>: Failed to establish a new connection: [Errno 111] Connection refused',))] errno:None on GET http://localhost:2990/jira/rest/api/2/serverInfo
{'response': None, 'request': <PreparedRequest [GET]>}\{'response': None, 'request': <PreparedRequest [GET]>}
WARNING:root:Got recoverable error from GET http://localhost:2990/jira/rest/api/2/serverInfo, will retry [1/3] in 6.9469562842627175s. Err: HTTPConnectionPool(host='localhost', port=2990): Max retries exceeded with url: /jira/rest/api/2/serverInfo (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f4cae23c048>: Failed to establish a new connection: [Errno 111] Connection refused',))
^CTraceback (most recent call last):
But atlassian package seems to work at least login part and retrieve project information:
jira = Jira(
url=JIRA_SERVER_IP[JIRA_SERVER_PROFILE],
username=JIRA_SERVER_AUTH_BASIC[JIRA_SERVER_PROFILE].split()[0].strip(),
password=JIRA_SERVER_AUTH_BASIC[JIRA_SERVER_PROFILE].split()[1].strip())
#JQL = 'project = gg-proj-000 AND status IN ("To Do", "In Progress") ORDER BY issuekey'
JQL = 'project = gg-proj-000'
data = jira.jql(JQL)
output:
Using atlassian library...
<class 'str'>
Why the first one working? Which package is more prominent and widespread usage?