2016-05-29 14 views
0

我使用吉拉庫Python創建吉拉-問題,但得到以下錯誤:Python的吉拉創建問題給屏幕錯誤

jira.exceptions.JIRAError: JiraError HTTP 400

text: Field 'Component/s' cannot be set. It is not on the appropriate screen, or unknown.

url: http://jira.corp.inmobi.com/rest/api/2/issue

response headers = {'X-AUSERNAME': 'noc', 'X-ASEN': 'SEN-2505611', 'X-Content-Type-Options': 'nosniff', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'X-Seraph-LoginReason': 'OK', 'Vary': 'User-Agent', 'X-AREQUESTID': '125x24693491x2', 'X-ASESSIONID': '1tjvpeo', 'Connection': 'close', 'Cache-Control': 'no-cache, no-store, no-transform', 'Date': 'Sun, 29 May 2016 02:05:05 GMT', 'Server': 'Apache-Coyote/1.1', 'Content-Type': 'application/json;charset=UTF-8'}

response text = {"errorMessages":[],"errors":{"Component/s":"Field 'Component/s' cannot be set. It is not on the appropriate screen, or unknown."}}

任何人都可以請幫我理清了嗎?

+0

你可以發佈你發送的JSON嗎? – EngineerCamp

+0

從jira.client進口JIRA 進口CGI,cgitb 選項= { '服務器': 'http://jira.server.com'} JIRA = JIRA(選項,basic_auth =( '用戶名',「密碼')) root_dict = { '項目':{ '鍵': 'ABC'}, '摘要': '測試', '描述':' 忽略此。很快就會被刪除」, '問題類型':{ '名稱': '任務'}, '分量/ S':[{ '名稱': 「ABC」}], } my_issue = JIRA。 create_issue(fields = root_dict) –

回答

0

Jira抱怨'Component\s'的意外反斜槓。

將其更改爲:

'components: [{'name' : "ABC"}]'

,它應該解決您的問題(雙關語意)。

+0

感謝Bro ..解決了...但我仍然感到驚訝,因爲我嘗試了同一個但它不工作..現在它工作...非常感謝.. :) –

+0

@viveksinha no如果是解決方案,請隨時接受我的回答。 – EngineerCamp