i am trying to create forge app using UI kit where i want to fetch data from jira datacenter using API and my jira DC is running on http://localhost:8080 but localhost is not supporting and after adding all required permission into manifest.yml file it is showing error like “The domain http://localhost:8080/rest/api/2/project/TEST/avatars is not included in the external permissions of your app manifest egress-permission-required” in my index.jsx file i am trying to get avatars from Jira data center using API and that API is -‘http://localhost:8080/rest/api/2/heena.hc15/avatars’ but i am facing error like provide permission
Hi Heena, as discussed here Forge functions (including UI Kit) run on a backend provided by Atlassian and won’t be able to access your localhost. If you want to use an API you’re hosting yourself you need to use ngrok or a similar tool to expose it.
Hi Adam ,i have used ngrok instead of localhost but when i am trying to use ngrok API it is showing me error “POST /rest/analytics/1.0/publish/bulk 403” i have checked API provided by ngrok it is giving me 200 status code with response in postman but when i am running in Atlassian forge it is showing me error. can you please provide me some doc to refere while calling data center API from forge using ngrok
Thanks&Regards
Heena.
Hi @Heenachaudhary ,
Have you added your ngrok domain to the list of allowed egress domains? See: https://developer.atlassian.com/platform/forge/runtime-egress-permissions/
Also, how are you authenticating with your DC instance when you make these API calls?
Hi @mventnor ,
this is my manifest.yml file
modules:
jira:projectPage:
- key: apiavtar-hello-world-project-page
function: main
title: APIAvtar
function:
- key: main
handler: index.run
permissions:
content:
styles:
- unsafe-inline
external:
fetch:
backend:
- “https://bc19-157-47-52-3.ngrok-free.app/rest/api/2/project/TEST/avatars”
scopes:
- manage:jira-configuration
- read:jira-work
- read:me
- read:jira-user
- read:avatar:jira
- read:field:jira
- read:avatar:jira
- read:project-category:jira
- read:project:jira
- read:field-configuration:jira
- read:issue-meta:jira
- read:issue-security-level:jira
- read:issue.vote:jira
- read:issue.changelog:jira
- read:issue:jira
- read:status:jira
- read:user:jira
- read:custom-field-contextual-configuration:jira
- write:field:jira
- read:field.option:jira
- write:field.option:jira
- write:jira-work
- write:issue.property:jira
- read:board-scope.admin:jira-software
app:
id: ari:cloud:ecosystem::app/6754cd76-2271-4e44-a70e-955e57c1a9dd
and while calling API for data center i am using basic authentication with username and password
this is my index.jsx
const fetchAvatars = async () => {
const username = ‘’;
const password = ‘’;
const url = ‘https://bc19-157-47-52-3.ngrok-free.app/rest/api/2/project/TEST/avatars’;
const response = await fetch(url, {
method: ‘GET’,
headers: {
‘Authorization’: Basic ${btoa(
${username}:${password})}
,
‘Accept’: ‘application/json’
}
});
const responseData = await response.json();
const { system } = responseData;
const avatars = system.map(avatar => avatar.urls[‘48x48’]);
return avatars;
};
i am not able to call API.
Thanks&Regards,
Heena chaudhary.