1

I am trying to use the rest API functionalities in JIRA which is proviced by its python module. Here is the code :

from jira import JIRA
options = {
'server': 'https://jira.internal.server',
'verify': 'false'
}

jira = JIRA(options, basic_auth=('usernXXXX', 'PassXXXX'))

After this I am getting the error :

WARNING:root:[Errno 2] No such file or directory while doing GET 
https://jira.internal.server/rest/api/2/serverInfo [{u'headers': {'Accept-
Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-
Agent': 'python-requests/2.13.0', 'Connection': 'keep-alive', u'X-Atlassian-
Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': 
u'application/json'}, 'params': None}]

I have checked the URL through rest client and CUrl https://jira.internal.server/rest/api/2/serverInfo it gives me perfect result

can anyone help here??

Rebbeca
  • 71
  • 8
  • Did you try using just the server string as the first parameter instead of the options dict? – ZeddZull Apr 06 '17 at 15:23
  • yes it didnot work, also the documentation in JIRA shows the same format as to pass the parameters as dict – Rebbeca Apr 07 '17 at 15:34

1 Answers1

3
from jira import JIRA
options = {
'server': 'https://jira.internal.server',
'verify': False
}

jira = JIRA(options, basic_auth=('usernXXXX', 'PassXXXX'))

You need to change the 'false' to False, because in that case a boolean is needed, not a string. The best solution would be to provide the path to the CA like '/path/ca/cert.pem'. See requests SSL Cert Verification

Keine-Ahnung
  • 601
  • 1
  • 5
  • 15