How to fetch REST APIs from Jira Cloud from Java Spring Boot?

I am trying to send request to JIRA cloud server which we have to fetch REST APIs through Spring Rest Template. But I am unable to establish connection. In console it is showing like connection refused.JIRA_error.JPG

I am using Spring Rest Template basic authorization feature. Kindly help me how to establish connection from Java to Jira. Also I have tried JRJC library, there also its showing same console error.

1 answer

0 votes
Tarun Sapra Community Champion Dec 13, 2017

Did you first try with "curl" from command prompt? Is the curl command working fine?

I am able to fetch data when I check from Postman

Also if we try to fetch from Angular 5 Http get, it says,cors1.JPG

Tarun Sapra Community Champion Dec 13, 2017

have you tried jsonP with angularjs?

var url = "https://api.getevents.co/event?&lat=41.904196&lng=12.465974";$http({    method: 'JSONP',    url: url}).success(function(status) {
    //your code when success
}).error(function(status) {
    //your code when fails
});

 

https://stackoverflow.com/questions/29547003/angularjs-no-access-control-allow-origin-header-is-present-on-the-requested-r

Hey...thanks for your quick reply. I am able to fetch data using Spring Boot rest template. My system was under organization proxy control so I set the proxy and now able to fetch.

Only one query, how to do this on Angular 5 if we are under proxy.

 

Thanks

angular is also running on your localhost, so if you local system can pass the proxy thus so can angular code. You have to make sure that your local system is allowed to cross the proxy and use JsonP concept in angularJS

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,167 views 13 19
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot