我正在尝试使用 Python-Jira API 创建 Jira 问题,但源和区域字段出现屏幕错误。请帮我解决这个问题。
错误:
Exception Value:
JiraError HTTP 400
text: Field 'source' 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': 'Vivek.Sinha', 'X-ASEN': 'SEN-2505611', 'X-Content-Type-Options': 'nosniff', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'X-Seraph-LoginReason': 'OK', 'Vary': 'User-Agent', 'X-AREQUESTID': '777x24903741x3', 'X-ASESSIONID': '6dg96h', 'Connection': 'close', 'Cache-Control': 'no-cache, no-store, no-transform', 'Date': 'Mon, 30 May 2016 12:57:34 GMT', 'Server': 'Apache-Coyote/1.1', 'Content-Type': 'application/json;charset=UTF-8'}
response text = {"errorMessages":[],"errors":{"source":"Field 'source' cannot be set. It is not on the appropriate screen, or unknown."}}
代码:
def create(request):
if 'name' in request.GET:
n=request.GET['name']
options={'server':'http://jira.com'}
jira=JIRA(options,basic_auth=('username','passwd'))
root_dict={
'project':{'key':'TS'},
'issuetype':{'name':'Issue'},
'summary':'Test',
'description':'Test',
'source':[{'name':'Walk-ups'}],
'type':{'name':p},
'region':{'name':'INDIA'},
}
my_issue=jira.create_issue(fields=root_dict)