Hi, When I try to make API calls from within a Forge App the host is resolved to “jira” and an error is thrown. In the browser, the error is:
Refused to connect to ‘https://jira/rest/api/3/issuetype’ because it violates the following Content Security Policy directive: “connect-src ‘self’ https://api.atlassian.com/metal/ingest”.
In the app, my code is:
import api, { route } from "@forge/api";
const getIssueTypes = async () => {
try {
console.log("Start");
const response = await api.asApp().requestJira(route`/rest/api/3/issuetype`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
} catch (error) {
console.log("Error: ", error);
throw error;
}
}
The permissions seem to be fine as I have added the scopes to the manifest.
What am I doing wrong?