We have created a Jira plugin. From the velocity template we are trying to call url of other application. Browser network call show success (status 200) and also received data. But within velocity template, it is showing status as 0 and no data. What extra we need to do to receive data in the velocity template
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", url, false);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
alert("rootUri service call success");
alert(xmlhttp);
alert(xmlhttp.responseText);
}
else {
alert("url service call fail");
alert(xmlhttp.status);
alert(xmlhttp);
alert(xmlhttp.responseText);
}
}
};
xmlhttp.send();
Able to resolve the CORS by adding a proxy rest service in jira server which actually route the call to other server. So, Jira UI will call proxy rest service which will route the call to CORS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.