Search code examples
jiradashboard

Atlassian Forge Jira Dashboard Gadget - No "entryPoint" for edit mode


I am working on a Custom UI Dashboard Gadget using the forge documentation here. The documentation refers to the context.extension.entryPoint. I can retrieve and see the context, and context.extension in the values returned by view.getContext() but there is no entryPoint key in the returned object.

How should I determine whether the dashboard is in edit mode so that I can configure my gadget?

Relevant code is.

import { view } from '@forge/bridge';

const context = await view.getContext()
console.info(JSON.stringify(context))

Solution

  • The Atlassian documentation says "With a Custom UI, you can define the same resource for viewing and editing your dashboard gadget" and then goes on to describe the code I posted above for retrieving the context. I have been unable to use the same component for configuring the dashboard because there is no 'edit' information in the context. The only solution I have managed to find is to create a separate component for configuring the dashboard and thus specifying the below manifest, which points at a separate component for editing.

    jira:dashboardGadget:
        ...
          resource: dashboard-quality
          resolver:
            function: resolver
          edit:
            resource: dashboard-quality-edit
    

    This seems to work and it isn't much additional effort, so I am going to accept this as an answer to my own Q, even though it doesn't really solve it based on my original intent.