1

I'm trying to follow AngularJS $http, CORS and http authentication to get filter results from JIRA and I can't make it work.

If I use the GET method, the console reports:

XMLHttpRequest cannot load https://.../rest/api/2/search?jql=filter=28203. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

Even though I've set useXDomain.

If I use the JSONP method, my success callback never gets invoked. I've tried .success, .then, and JSON_CALLBACK and none work. While JSONP isn't suppose to work at all in modern JIRA, I can see a successful response with the expected data in Chrome's Developer Tools' network work tab but the console reports:

Refused to execute script from 'https://.../rest/api/2/search?jql=filter=28203' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.

My code -- based on that from the CORS question above -- is at https://plnkr.co/edit/IO4air3eN2vDoaOXJous?p=preview

What am I missing?

Chris Nelson
  • 3,519
  • 7
  • 40
  • 51
  • 1
    Wonder if you’re hitting this bug: https://jira.atlassian.com/browse/JRASERVER-59101 from the recent comments it’s not clear that bug has actually been fixed – sideshowbarker Aug 02 '17 at 05:39
  • 1
    See also https://community.atlassian.com/t5/Answers-Developer-Questions/Enable-CORS-in-JIRA-REST-API/qaq-p/553997#M115161 – sideshowbarker Aug 02 '17 at 05:42

0 Answers0