当我在代码中调用create issue API时遇到问题,错误是It is not on the appropriate screen
或未知。但是,在邮递员中尝试使用具有相同参数的测试API时,它会成功,是否有人知道此错误的原因?
这是我的代码:
create_url = "https://myjira/rest/api/2/issue/"
jira_hash =
{
"fields": {
"project": {
"id": "51606"
},
"issuetype": {
"name": "SOAK EVENT"
},
"priority": {
"name": "Critical"
},
"labels": ["Chandler"],
"customfield_10012": {
"id": "10006"
},
"fixVersions": [{
"name": "2019-05-r1"
}],
"summary": "10297",
"description": "description"
}
}
HTTParty.post(create_url,
:body => jira_hash.to_json,
:headers => {'Content-Type' => 'application/json', 'Authorization'
=> auth})