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();