Unable to open a dialog from link in admin_plugins_menu

Greetings all!

I’ve created a simple add-on that opens a dialog from a link in the operations-operations menu - it works great. Next, I am trying open a dialog from a link in the admin_plugins_menu. When I click on the link, I get a 404 (and no dialogs open). Are dialogs supported here? I haven’t got too far yet but I figured it would be handy to operate within a dialog so I could use the client API to store configuration properties in JIRA. Just supplying a url property works fine. The documentation doesn’t indicate dialogs wouldn’t be supported here AFAICT:

The properties required for this location are the standard ones defined in the documentation for web sections and web items.

Here is my atlassian-connect.json:

{
  "name": "Hello World",
  "description": "Atlassian Connect app",
  "key": "com.vspr.ai",
  "baseUrl": "https://changeme.ngrok.io",
  "vendor": {
    "name": "vspr.ai",
    "url": "https://vspr.ai"
  },
  "authentication": {
    "type": "none"
  },
  "apiVersion": 1,
  "modules": {
    "webItems": [{
        "key": "hello-world-tools-item",
        "location": "operations-operations",
        "weight": 10,
        "name": {
          "value": "Hello World"
        },
        "target": {
          "type": "dialogmodule",
          "options": {
            "key": "do-thing-dialog"
          }
        }
      },
      {
        "key": "hello-world-section-link",
        "location": "admin_plugins_menu/hello-world-menu-section",
        "weight": 10,
        "name": {
          "value": "Settings"
        },
        "target": {
          "type": "dialogmodule",
          "options": {
            "key": "hello-world-settings-dialog"
          }
        }
      }
    ],
    "webSections": [{
      "key": "hello-world-menu-section",
      "location": "admin_plugins_menu",
      "name": {
        "value": "Hello World"
      }
    }],
    "dialogs": [{
        "url": "/index.html",
        "options": {
          "height": "200px",
          "width": "300px"
        },
        "key": "do-thing-dialog"
      },
      {
        "url": "/index.html",
        "options": {
          "size": "fullscreen",
          "header": {
            "value": "Hello World Settings"
          }
        },
        "key": "hello-world-settings-dialog"
      }
    ]
  }
}

Thanks in advance!

Hi @cobb,

You can refer to this project for the dialog Glitch :・゚✧. After installing it, click on the “CLICK THIS THING” and there’s a sample execution for the dialog at the bottom part:

You can even remix your own project. Hope this helps.

Cheers,
Anne Calantog

Thanks for the reply @acalantog!

I remixed the project you sent me to illustrate the problem that I am seeing:

Hopefully that works, if not, I will copy the entire json file below. What I can’t get to work is a dialog opening from a link in the admin_plugins_menu. In this scenario, I don’t have a panel to execute the javascript from the example you sent me. I can link to an external page, which I can make work but I was hoping to do my plugin’s configuration inside jira itself rather than on an external page.

Here is the json I promised in cased I goofed the glitch:

{
  "key": "jira-bootcamp",
  "name": "JIRA Static Connect Add-on",
  "baseUrl": "https://quartz-gas.glitch.me",
  "authentication": {
    "type": "none"
  },
  "modules": {
    "generalPages": [{
      "url": "/general-page.html",
      "key": "my-general-page",
      "location": "system.top.navigation.bar",
      "name": {
        "value": "CLICK THIS THING!"
      }
    }],
    "webSections": [{
      "key": "jira-add-on-menu-section",
      "location": "admin_plugins_menu",
      "name": {
        "value": "jira add-on"
      }
    }],
    "webItems" : [
      {
        "key": "jira-bootcamp-section-link",
        "location": "admin_plugins_menu/jira-add-on-menu-section",
        "weight": 10,
        "name": {
          "value": "Settings"
        },
        "target": {
          "type": "dialogmodule",
          "options": {
            "key": "my-dialog"
          }
        }
      },
      {
        "key": "jira-bootcamp-tools-item",
        "location": "operations-operations",
        "weight": 10,
        "name": {
          "value": "Open Dialog"
        },
        "target": {
          "type": "dialogmodule",
          "options": {
            "key": "my-dialog"
          }
        }
      }
    ],
    "dialogs": [{
      "url": "/dialog.html",
      "options": {
        "size": "fullscreen",
        "header": {
          "value": "Example Dialog"
        }
      },
      "key": "my-dialog"
    }],
    "webPanels": [{
      "url": "/web-panel.html",
      "location": "atl.jira.view.issue.right.context",
      "layout": {
        "width": "10px",
        "height": "100%"
      },
      "weight": 50,
      "name": {
        "value": "My Web Panel"
      },
      "key": "my-web-panel"
    }]
  },
  "scopes": [
    "READ"
  ]
}

I see now that I was trying to reinvent the wheel and there is already an idiomatic way to provide configuration for an add-on:

https://developer.atlassian.com/cloud/jira/platform/modules/page/

configurePage - a “Configure” button will link to this page from the add-on’s entry in Manage Add-ons. Use this page to provide configuration of the add-on itself.

Thanks for your help!

Hi @cobb,

Sorry I missed that question. I was focusing more on the dialog rather than the configuration page. Yes, please use the configuration module for your app’s settings, etc. Glad you were able to see that.

Cheers,
Anne Calantog