什么是jira-python连接的服务器?

时间:2013-08-08 21:13:54

标签: python jira

我想使用python在JIRA上创建问题,所以我正在Welcome to jira-python's documentation上学习。

但是第一个问题困扰着我。如果我们使用自己的JIRA,服务器是什么?在此文档中,它使用https://jira.atlassian.com。如果我使用的是JIRA,其网址如下:https://bugs.company.com/secure/Dashboard.jspa。我的服务器是什么?

现在,我正在使用

jira = JIRA(options={'server': 'https://bugs.company.com'})
projects = jira.projects()
keys = [project.key for project in projects]

我会收到错误:

Traceback (most recent call last):
  File "MethodTest.py", line 9, in <module>
    projects = jira.projects()
  File "/Library/Python/2.7/site-packages/jira/client.py", line 838, in projects
r_json = self._get_json('project')
  File "/Library/Python/2.7/site-packages/jira/client.py", line 1423, in _get_json
r_json = json.loads(r.text)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

1 个答案:

答案 0 :(得分:2)

问题可能来自您使用与jira实例的安全连接这一事实。您需要为连接设置适当的证书,或者只是禁用证书验证。

请参阅jira.client.JIRA选项并将verify设置为False

jira = JIRA(options={'server': 'https://bugs.company.com',
                     'verify': False})

您是否设置了正确的用户名和密码?

最后,您可能需要咨询您的IT部门以获取正确的网址。