Get issue limit report not working from Forge

Looks like making GET requestJira with body included not possible with node-fetch limitation of Get and Head not containing request body.

ERROR   12:35:46.285  058c41c2-676a-4f34-a42c-4d9c3be6aa63  Error: TypeError: Request with GET/HEAD method cannot have body
    at Request (webpack://jira-issue-panel-ui-kit-2/node_modules/node-fetch/lib/index.mjs:1215:1)
    at <anonymous> (webpack://jira-issue-panel-ui-kit-2/node_modules/node-fetch/lib/index.mjs:1443:1)
    at new Promise (<anonymous>)
    at fetch (webpack://jira-issue-panel-ui-kit-2/node_modules/node-fetch/lib/index.mjs:1441:1)
    at <anonymous> (webpack://jira-issue-panel-ui-kit-2/node_modules/@forge/api/out/api/fetch.js:27:1)
    at requestJira (webpack://jira-issue-panel-ui-kit-2/node_modules/@forge/api/out/api/index.js:21:1)
    at <anonymous> (webpack://jira-issue-panel-ui-kit-2/src/resolvers/index.js:7:31)
    at Object.resolve (webpack://jira-issue-panel-ui-kit-2/node_modules/@forge/resolver/out/index.js:55:1)
    at /Users/user/ProjectsWork/brizo/forge-helloworld/.forge/tunnel-output/__forge_wrapper__.cjs:2:616655
    at w (/Users/user/ProjectsWork/forge-helloworld/.forge/tunnel-output/__forge_wrapper__.cjs:2:616661)

But I need to pass for this Jira API
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-limit-report-get

Can somebody advice? First thought is to integrate Axios and use for that request.
Also this way, how can I access current user token for the authenticated request?

Hello @OlehKosar

The inability of the built-in node-fetch module and the requestJira() method to use the new Get issue limit report endpoint is a known problem. As for Axios, it’s been widely reported that it can’t be used with Forge, but you’re welcome to try it for yourself and find out.

Others have encountered the same problem with the new API endpoint using other languages / frameworks, as per this thread.

1 Like

@sunnyape it looks like Axios works in their new NodeJs environment.

Possibly problems was with the previous legacy env.: https://developer.atlassian.com/platform/forge/runtime-reference/legacy-runtime-reference/

1 Like

Oh, that’s sort of good news. Sounds like using Axios might be a semi-viable workaround for the time being.