無法通過AJAX和REST API添加問題。我可以讓它與郵差工作,不幸的是,無法獲得Ajax請求。JIRA Rest API錯誤。無法識別的令牌創建問題
我創建的JSON很好,也是發佈請求。 issuetype是我自己創建的,使用Bug給出了同樣的問題。見創建的JSON對象,我的錯誤和我的代碼: JSON對象(這是來自的console.log片段):
的誤差
0:「無法識別的令牌「fils5poet5 「:期待 '空', '真', '假' 或NaN↵在[來源: [email protected];行:1, 柱:21]」
jira = {
fields : {
project : {
key : "CIC"
},
summary : "test",
description: "test",
issuetype : {
name : "Sandbox item"
}
}
};
console.log(jira); //Also see image at top of this post.
// Submit to Jira api
$.ajax({
type : "POST",
dataType : "JSON",
url : configuration.api_url,
beforeSend: function (xhr) {
xhr.setRequestHeader ("Authorization", "Basic ItsAWrap!(itworks...)"),
xhr.setRequestHeader ("Content-Type", "application/json");
},
data : jira,
success : (function(response) {
//Do something
}})