The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get all issues from Jira and all tasks from Confluence over the API to a user

Henning Karl
July 11, 2019

Hello to all, @Julia Riedinger  and I need some help.

We want develop a website where we show all tasks per user from Confluence and Jira.
We are not getting any further here, maybe you can help us.

Here the situation:

I’m trying to get all the tasks from Jira and Confluence assigned to a particular user by making an XMLHTTPRequest in a local development environment in JavaScript.

The APIs I’m using are https://{jira-domain}/rest/api/2/search for Jira and https://{confluence-domain}/rest/mywork/latest/task for Confluence whereat I still need to pass the name of a user whose tasks I want to receive.

 

Currently the request won’t deliver any data due to an error caused by CORS that blocks cross-origin HTTP requests.

The Jira API request is blocked because there is no ‘Access-Control-Allow-Origin’ header present on the requested resource. The Confluence API request is blocked because this header is set to a wildcard ‘*’ and this is not allowed when the withCredentials attribute of the HTTP request is set to true. If this attribute is set to false the error message says that the request doesn’t have HTTP ok status.

There is an Add-On for Mozilla Firefox called CORS Everywhere that bypasses the CORS rules. With this Add-On activated the data from Jira API request will be displayed but still not from Confluence API request.

 

With the reverse proxy Cors-Anywhere that is meant to set the missing headers in an HTTP request the API requests both result in a 404 Not Found error.

 

code_snippet.png

 

confluence_error.png

 

jira_error.png

Thanks and kind regards,
Henning

0 comments

Comments for this post are closed

Community moderators have prevented the ability to post new comments.

TAGS
AUG Leaders

Atlassian Community Events