我正在尝试使用REST API检索JIRA插件中的问题,但是当我提供身份验证信息时,它会在之后以该用户身份登录。我想在不更改用户的情况下检索问题。这是我的AJAX:
jQuery.ajax({
type: "GET",
url: "http://jdev.tmaxlaunch.com/rest/api/2/search?jql=cf[10201]=" + id,
//headers: { 'Authorization': 'Basic xxxxxxxxx' },
dataType: "json",
success: function(data) {
console.log(data);
//console.log(data.issues);
//console.log(data.issues[0]);
for (i = 0; i < data.issues.length; i++){
console.log(data.issues[i].id);
AJS.$('.activity-chart').append('<p>' + data.issues[i].fields.summary + '</p>');
}
},
error: function(xhr,textStatus,err)
{
console.log("readyState: " + xhr.readyState);
console.log("responseText: "+ xhr.responseText);
console.log("status: " + xhr.status);
console.log("text status: " + textStatus);
console.log("error: " + err);
}
});