打開調試看看會發生什麼:
import httplib
httplib.HTTPConnection.debuglevel= 1
實例連接到公共JIRA:
>>> from jira.client import JIRA
>>> import httplib
>>> httplib.HTTPConnection.debuglevel= 1
>>> options = {
... 'server': 'https://jira.atlassian.com'
... }
>>> jira = JIRA(options)
>>> issues = jira.search_issues('project=JSD')
send: 'GET /rest/api/2/search?jql=project%3DJSD&startAt=0&maxResults=50 HTTP/1.1\r\nHost: jira.atlassian.com\r\nUser-Agent: python-requests/2.2.1 CPython/2.7.5 Darwin/13.0.0\r\nAccept-Encoding: gzip, deflate, compress\r\nAccept: */*\r\nX-Atlassian-Token: nocheck\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: nginx
header: Date: Wed, 26 Feb 2014 06:17:33 GMT
header: Content-Type: application/json;charset=UTF-8
header: Transfer-Encoding: chunked
header: Connection: keep-alive
header: X-AREQUESTID: 377x7779615x3
header: X-ASEN: TestSEN
header: X-AUSERNAME: anonymous
header: Cache-Control: no-cache, no-store, no-transform
header: X-Content-Type-Options: nosniff
header: X-Robots-Tag: noarchive
header: Vary: Accept-Encoding
header: Content-Encoding: gzip
header: Set-Cookie: __atl_path=172.24.36.107.1393395450345419; path=/; expires=Sat, 24-Feb-24 06:17:30 GMT; domain=.atlassian.com
header: Set-Cookie: atlassian.xsrf.token=AKVY-YUFR-9LM7-97AB|ecb611160886e0c356f238dc407f015375fffb40|lout; Path=/
header: Set-Cookie: JSESSIONID=DA80ADFD3371C4FA2B06F54037B48BB9; Path=/
>>> print issues
[<JIRA Issue: key=u'JSD-361', id=u'319731'>, <JIRA Issue: key=u'JSD-360', id=u'319715'>, <JIRA Issue: key=u'JSD-359', id=u'319714'>, <JIRA Issue: key=u'JSD-358', id=u'319676'>, <JIRA Issue: key=u'JSD-357', id=u'319459'>, <JIRA Issue: key=u'JSD-356', id=u'319436'>, <JIRA Issue: key=u'JSD-355', id=u'319225'>, <JIRA Issue: key=u'JSD-354', id=u'319201'>, <JIRA Issue: key=u'JSD-352', id=u'319192'>, <JIRA Issue: key=u'JSD-351', id=u'319189'>, <JIRA Issue: key=u'JSD-350', id=u'319177'>, <JIRA Issue: key=u'JSD-349', id=u'318912'>, <JIRA Issue: key=u'JSD-348', id=u'318911'>, <JIRA Issue: key=u'JSD-347', id=u'318846'>, <JIRA Issue: key=u'JSD-346', id=u'318840'>, <JIRA Issue: key=u'JSD-345', id=u'318539'>, <JIRA Issue: key=u'JSD-344', id=u'318537'>, <JIRA Issue: key=u'JSD-343', id=u'318492'>, <JIRA Issue: key=u'JSD-342', id=u'318459'>, <JIRA Issue: key=u'JSD-340', id=u'318303'>, <JIRA Issue: key=u'JSD-338', id=u'318128'>, <JIRA Issue: key=u'JSD-337', id=u'318039'>, <JIRA Issue: key=u'JSD-336', id=u'318021'>, <JIRA Issue: key=u'JSD-335', id=u'318020'>, <JIRA Issue: key=u'JSD-334', id=u'318014'>, <JIRA Issue: key=u'JSD-333', id=u'317923'>, <JIRA Issue: key=u'JSD-332', id=u'317908'>, <JIRA Issue: key=u'JSD-331', id=u'317829'>, <JIRA Issue: key=u'JSD-330', id=u'317825'>, <JIRA Issue: key=u'JSD-329', id=u'317821'>, <JIRA Issue: key=u'JSD-328', id=u'317803'>, <JIRA Issue: key=u'JSD-327', id=u'317801'>, <JIRA Issue: key=u'JSD-326', id=u'317800'>, <JIRA Issue: key=u'JSD-325', id=u'317798'>, <JIRA Issue: key=u'JSD-324', id=u'317769'>, <JIRA Issue: key=u'JSD-323', id=u'317747'>, <JIRA Issue: key=u'JSD-322', id=u'317646'>, <JIRA Issue: key=u'JSD-321', id=u'317603'>, <JIRA Issue: key=u'JSD-320', id=u'317601'>, <JIRA Issue: key=u'JSD-319', id=u'317599'>, <JIRA Issue: key=u'JSD-318', id=u'317541'>, <JIRA Issue: key=u'JSD-317', id=u'317499'>, <JIRA Issue: key=u'JSD-316', id=u'317462'>, <JIRA Issue: key=u'JSD-315', id=u'317460'>, <JIRA Issue: key=u'JSD-314', id=u'317440'>, <JIRA Issue: key=u'JSD-313', id=u'317436'>, <JIRA Issue: key=u'JSD-312', id=u'317358'>, <JIRA Issue: key=u'JSD-311', id=u'317355'>, <JIRA Issue: key=u'JSD-310', id=u'317353'>, <JIRA Issue: key=u'JSD-309', id=u'317281'>]
你會看到告訴你JQL可以在你的請求中輸出。應該給你一個關於如何解決問題的想法。
這是Python 2.7.5
和JIRA 6.2
但是我也試過Jira 6.0.7
它工作。
此外,您可以嘗試將您的JQL調整爲完整的項目名稱而不是密鑰,如果它包含空格將其包含在引號中。
在瀏覽器中輸入JQL並查看JIRA更改它的內容。也許TITAN全部大寫? – mdoar