JIRA - Editing a Custom UI Dashboard Gadget Produces an Error

Hi.
I’m working on a custom UI Dashboard Gadget for JIRA Cloud but I am running into problems when I want to add edit functionality to the gadget.

The gadget is rendering and getting the right context, but the edit functionality is not working.

According to the documentation found here: Jira dashboard gadget it should be possible.

The example on the page looks like this:

# manifest.yml
modules:
  jira:dashboardGadget:
    - key: hello-world-gadget
      title: Hello world!
      description: A hello world dashboard gadget.
      thumbnail: https://developer.atlassian.com/platform/forge/images/icons/issue-panel-icon.svg
      resource: main # the resource used to view our dashboardGadget
      resolver:
        function: resolver
      edit:
        resource: main # the same resource, used to edit our dashboardGadget configuration
resources:
  - key: main
    path: static/hello-world/build

They are specifying both ressource and edit.

When I do the following in my manifest.yml (I have removed lines for the other functionality):

# manifest.yml
...
    - key: my-very-cool-custom-ui-gadget
      title: My Very Cool
      description: My very descriptive description
      thumbnail: https://developer.atlassian.com/platform/forge/images/icons/issue-panel-icon.svg
      resource: my-resource-id
      resolver:
          function: myResolver
      edit:
        function: my-resource-id
...

When I then run forge lint I get the following output/error:

❯ forge lint
The linter checks the app code for known errors. Warnings are issues you should fix, but they won't stop the app code from building.
Press Ctrl+C to cancel.

/path-to-project/my-very-cool-project/manifest.yml
2:2     error    jira:dashboardGadget required properties are 'description, function, title, key' or 'description, resource, title, key'  valid-document-required

X 1 issue (1 error, 0 warnings)
  Issue found is not automatically fixable with forge lint.

If I remove the edit key it lints, but of course then I cant edit the gadget.

Any suggestions as to what I’m doing wrong :)?

Hi @CarstenGrnbjergLtzen
You have used the function key under edit. It should be resource instead.
This will work:

    - key: my-very-cool-custom-ui-gadget
      title: My Very Cool
      description: My very descriptive description
      thumbnail: https://developer.atlassian.com/platform/forge/images/icons/issue-panel-icon.svg
      resource: my-resource-id # the resource used to view our dashboardGadget
      resolver:
        function: myResolver
      edit:
        resource: my-resource-id```
1 Like

Thanks! That makes so much sense! I simply overlooked it! Sorry!

Thank you!