REQUEST_EGRESS_ALLOWLIST_ERR when using fetch to call jira api

Tim Pew September 3, 2024

Writing my first forge app to add a custom JQL function which calls the jira api via fetch, and no matter what I've tried in the manifest.yml I still get the REQUEST_EGRESS_ALLOWLIST_ERR.

This is what I currently have in the yaml:

permissions:

  external:
    fetch:
      backend:
        - 'https://<my-jira-instance>.atlassian.net/rest/api/3/search'
  scopes:
    - read:jira-work
The javascript line in question is "

 

const response = await fetch(`https://<my-jira-instance>.atlassian.net/rest/api/3/search?jql=parent=${issueKey}`);
Any thoughts what I'm doing wrong?

2 answers

1 accepted

0 votes
Answer accepted
surendra bisoyi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 22, 2024

Hi @Tim Pew ,

After updating the Forge API to the latest version, the issue was resolved. I used the command: npm install @forge/api@latest

This automatically updated the `package.json` file with the entry: "@forge/api": "^4.1.0".

Can you try once?

Tim Pew November 25, 2024

I was able to get help from Atlassian support last month and they had me do what you recommend and it worked for me as well. Thank you for your response.

0 votes
vikram
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 22, 2024

Hi @Tim Pew 

Welcome to Atlassian Community.

I too feel that their might be small difference in yaml file, can you please check below knowledge document for api call 

https://developer.atlassian.com/platform/forge/runtime-egress-permissions/

vikram P 

Tim Pew September 23, 2024

I've reviewed that document previously, and I've actually switched from using fetch to using requestJira with the route tagged template, but I still haven't got it to work, and I'm still getting a regress error even though the document you referenced indicates that calling the jira API shouldn't require any egress permissions.

vikram
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 23, 2024

Hi @Tim Pew 

Can you post the what changes you have done and the error you are getting. 

You can also get error info from <jira-home-directory>/jira/logs

can you post the error from this log also.

Vikram P 

 

Tim Pew September 23, 2024

This is the call that's getting the error:

      const response = await api
        .asApp()
        .requestJira(route`/rest/api/3/search`, {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            "Accept": "application/json"
          },
          body: bodyData
        });
and the error I get is:
[REQUEST_EGRESS_ALLOWLIST_ERR: URL not included in the external fetch backend permissions: /rest/api/3/search. Visit go.atlassian.com/forge-egress for more information.] {
status: 403
vikram
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2024

Hi @Tim Pew 

Try to check the below url, it might help.

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-issue-issueidorkey-attachments-post

--- instead of .asApi 

--- try using user 

Vikram P

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events