Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

api CORS issue from jira rest api to sonarqube

Hi Community,

I've the following ajax call from confluence to sonarqube:

// Sonarqube data AJS.$.ajax({ url: 'https://sonarqube.xx/api/prometheus/metrics', type: 'GET', dataType: 'json', "crossDomain": true, 'cache': false, contentType: 'application/json', beforeSend: function(xhr) { xhr.setRequestHeader('Authorization', "Basic " + btoa("xx" + ':' + "xx")); }, headers: { "Authorization": "Basic " + btoa("prom" + ':' + "prom"), "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET, POST, PATCH, PUT, DELETE, OPTIONS", "Access-Control-Allow-Headers": "Origin, Content-Type, X-Auth-Token", "Access-Control-Expose-Headers": "Content-Length, X-JSON" }, success: function(json) { console.log(json) }, error: function(err) { console.log(err) } });

however, I'm getting the following error:

Access to XMLHttpRequest at xx from origin '' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I was informed by the sonarqube admins that its not possible to add CORS on the sonarqube side. Is there still a way to get sonarqube data.
Please note that postman access to the sonarqube is fine using basic authorization.

Thanks in advance



Log in or Sign up to comment
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

677 views 17 19
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you