Having trouble getting Unresolved issues from API

I'm trying to use the REST API to count how many Resolved and Unresolved issues we have each day.

I'm very new to this. Do you see any glaring issues with how my code is written?

The Chrome error console is giving me:
"XMLHttpRequest cannot load http://managemebugs.myjetbrains.com/rest/issue/byproject/ManageMe?filter=%23Unresolved. Origin http://localhost:8888 is not allowed by Access-Control-Allow-Origin."

Any ideas or thoughts are very welcome.

<!DOCTYPE html>
<script type="text/javascript">
function loadXMLDoc()
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
xmlhttp.open("POST", "http://managemebugs.myjetbrains.com/rest/user/login?rootusername&rootpassword",true)

<button type="button" onclick="loadXMLDoc()">Request data</button>
<div id="myDiv"></div>

1 comment
Comment actions Permalink
Hello, Jeffrey!
This message says, that origin, that you are making request to (in your case it's your YouTrack server) does not allows request from another origin (in your case this is web page's origin, that contains your javascript). You can read more about CORS here
About CORS support in YouTrack you can read here
If you have any more questions - I am happy to help!
Also, as I can see from your code, you are executing
just once, but if there are too many Unresolved issues, they won't be returned to you. In this case you can use pagination.

Please sign in to leave a comment.