Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.
×I'm developing a Forge app that is listing out all the remote links associated with a customer request in Jira Service Management for all of the customers to see. My problem is that the api.asApp().requestJira(route`/rest/api/3/issue/${issueKey}/remotelink`); method is evaluated to: https://jira/rest/api/3/issue/MYISSUEKEY/remotelink instead of https://MYCOMPANY/rest/api/3/issue/MYISSUEKEY/remotelink. Thus violating the document's Content Security Policy, more specifically this directive: "connect-src 'self' https://api.atlassian.com/metal/ingest". I tried to use forge/bridge requestJira before, but as of my knowledge it only uses the user as the caller, so it doesn't meet my use-case, that customers should also be able to see the results. And also this is why I intend on using the app as a caller for the endpoint.
Here are the permissions I gave to the app:
Hi @Illés Ákos
You have to import route and use it to build your endpoint.
import api, { route } from '@forge/api';
api.asApp().requestJira(route`/rest/api/3/myself`);
Regards
Hi, thank you for your answer!
I indeed had some imports missing, but a bigger problem was that I could not invoke the REST API from the frontend for some reason and the reason for the error I believe was invoking from the frontend. I rewrote my code in the resolvers/index.js file and now it works fine. Also a good tip for anyone starting out and reads this, is that just because the forge cli tells you your latest version is installed it is not always the truth...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ya not easy to start. This video helped me a lot when I started with Forge and development using node and TS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.