Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

GET http call of url to other application returns status as 0 but browser network call show 200

Subhajit Bhuiya October 4, 2018

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

1 answer

1 accepted

0 votes
Answer accepted
Subhajit Bhuiya October 6, 2018

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events