Accessing Jira API from javascript ajax call getting CORS error

I have installed JIRA in my local machine and trying to use the REST API from another application which is installed in same machine.

While am calling the API from ajax call, I am getting the below CORS error.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at (Reason: CORS header 'Access-Control-Allow-Origin' missing).

Even I added the requesting URL in JIRA whitelist, but getting same error only.

2 answers


Have you set up headers:

headers = {

'Content-Type': 'application/json',
'X-Atlassian-Token': 'nocheck'

Are you working with iframes?

Is that JIRA cloud?


Thanks for your reply Aleks. I added those headers, but still its not working.

Are you working with iframes? - NO (using simple ajax call)

Is that JIRA cloud? - NO (installed in my local machine. I tired with JIRA cloud as well, getting same error)


This is my sample code,

    Test <button onclick="testJira();">Click</button>
        function testJira() {
                type: "GET",
                crossDomain: true,
                dataType: "json",
                url: "",
                headers: {
                    'Content-Type' : 'application/json',
                    'Authorization' : 'Basic something=',
                    'X-Atlassian-Token': 'no-check',
                    'Access-Control-Allow-Origin' : '*'
                success: function(result) {
                error: function(error) {
    <script src=""></script>

I have run same code but I got below error
"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."


please let me know How can I resolve this?

I have the very same issue (trying to use Confluence Cloud REST API rather than JIRA). Any news on this?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Wednesday in Jira

Join our webinar: How 1B+ feature flag events helped us build the new Jira

Every time you release software, there's a bit of risk – that there's a bug, that something breaks, or that the feature doesn't resonate with customers. Feature flagging helps make high stakes s...

139 views 0 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you