Hey folks,
I am working on a small Figma plugin and would like to access information (status, name) of Jira tickets. However, when I try to fetch data I get the CORS error
Access to fetch at 'https:/my-company.atlassian.net/rest/agile/1.0/issue/DT-25' from origin 'https://www.figma.com' 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. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
The Figma docs say the following
Note: because Figma and Figma plugins run inside a browser environment, Cross-Origin Resource Sharing policies apply. Plugins run inside an iframe with a null origin. This means that they will only be able to call APIs with Access-Control-Allow-Origin: *
(i.e., those that allow access from any origin). In the example above, we use a CORS proxy for simplicity, but it’s not something you generally need to or should use.
Does this mean that ultimately I will not be able to access Jira (unless they add the Access-Control-Allow-Origin: *
on the server side)? Or is there any way to get around this?
Thanks 🙂