getting "No 'Access-Control-Allow-Origin' header is present on the requested resource." error while trying to access jira through SharePoint App. Code being:
$.ajax({
type: "GET",
url: "https://XXXXXX.XXXXX.com/rest/api/2/project",
accept: "application/jsonp",
cache: false,
header:{'Access-Control-Allow-Origin':'*'},
username: "XXXX.XXXXX@XXXX.com",
password: "XXXXXX",
contentType: "application/jsonp; charset=UTF-8",
processData:true,
crossDomain: true,
dataType: "jsonp",
jsonp: 'jsonp-callback',
xhrFields: {
withCredentials: true
},
success: successMessage,
error: failMessage
})
function successMessage(data) {
processData(data);
}
function processData(data) {
}
function failMessage(xhr, status, errorThrown) {
console.log(errorThrown + '\n' + status + '\n' + xhr.statusText);
}