Hi guys. I’m developing a small Forge app which should make requests to my API. Currently I use 2 modules, that’s from the manifest.yml:
jira:issuePanel:
- key: my-issue-panel
icon: https://developer.atlassian.com/platform/forge/images/icons/issue-panel-icon.svg
render: native
resolver:
endpoint: remote-issue-panel
resource: main
title: Title
jira:issueAction:
- key: my-issue-action
render: native
resolver:
function: resolver
resource: action
title: My settings
function:
- key: resolver
handler: index.handler
endpoint:
- key: remote-issue-panel
remote: remote-backend
auth:
appUserToken:
enabled: true
appSystemToken:
enabled: true
permissions:
scopes:
- read:app-user-token
- read:app-system-token
- read:jira-user
- read:jira-work
- read:servicedesk-request
- storage:app
remotes:
- key: remote-backend
baseUrl: https://my-backend-api-url-here.com/
operations:
- storage
- compute
- fetch
storage:
inScopeEUD: true
resources:
- key: main
path: src/frontend/index.jsx
- key: action
path: src/frontend/action.jsx
So when I set or retrieve my inner API key in jira:issueAction
, everything works fine. When I request our API from the jira:issuePanel
, everything works fine. But when I want to retrieve API key in jira:issuePanel
using invoke from ‘@forge/bridge’ I get
Uncaught (in promise) Error: Invalid response from remote
at invoke
on global-bridge.js.
I tried changing resolver to function - then I can get the value from the storage but cannot request my API. The idea was to get the api key and add it to a context which is used by functions that request the API.
I also tried requestJira
inside those functions as the docs say I can use Jira REST API: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-app-properties/#api-rest-atlassian-connect-1-addons-addonkey-properties-propertykey-get
But It requires addonKey - and I have none since it’s Forge, not Connect app.
Thus:
- any ideas of how to get storage working for
jira:issuePanel
with an endpoint as a resolver
Or - maybe you could advise a better way to store API key inside Forge app?