The Dashboard widget is not shown in the available widget list

Hi All!

I’m newbie in Atlassian and doing some hello world widgets for Jira Cloud. I stuck with silly things related to the Dashboard Item. The add-on gets installed but then it is not displayed in the available gadgets list on the Dashboard once I click Add gadget button.
This addon contains ‘generalPages’ element and it works as expected, but the second part with the Dashboard Item is not…

Could you please give me advice on what did I miss?

Here is the ‘atlassian-connect.json’ file:

Thanks in advance!

{
  "key": "atlassian-connect-jira-dashboard-item-example",
  "name": "Atlassian Connect JIRA Dashboard Item Example",
  "description": "Dashboard-item test add-on",
  "vendor": {
    "name": "Tony",
    "url": "http://www.atlassian.com"
  },
  "baseUrl": "https://51c9f0d5.ngrok.io",
  "authentication": {
    "type": "jwt"
  },
  "enableLicensing": false,
  "lifecycle": {
    "installed": "/installed"
  },
  "modules": {
    "generalPages": [
      {
        "url": "/helloworld.html",
        "key": "hello-world",
        "location": "system.top.navigation.bar",
        "name": {
          "value": "Greeting"
        }
      }
    ],
    "jiraDashboardItems": [
      {
        "description": {
          "value": "Issues in project dashboard item"
        },
        "url": "/issues-in-project?dashboard={dashboard.id}&dashboardItem={dashboardItem.id}",
        "configurable": true,
        "thumbnailUrl": "/thumbnail",
        "name": {
          "value": "Issues in project"
        },
        "key": "iframe-requests",
        "conditions": [
          {
            "condition": "/condition?view={dashboardItem.viewType}&dashboard={dashboard.id}&dashboardItem={dashboardItem.id}"
          }
        ]
      }
    ]
  },
  "scopes": [
    "READ",
    "WRITE"
  ]
}

Hi @tohalitv,

Welcome to Atlassian!

Were you trying this bitbucket project: atlassian-connect-jira-dashboard-item-example?

If you are, by cloning it, I can see it in the gadget list:

Thanks!

Cheers,
Anne Calantog

Hi @acalantog!

Thank you for the response!
Did you introduce any changes in the cloned project? And what version of the node.js do you have?
I see the following warnings in the console after node app.js command:

Registering add-on...
Failed to register with host 923c9b99-7308-335a-91bf-f375321b7614 (401)
Add-on not registered; no compatible hosts detected

Maybe I face this issue because I run the add-on on Linux…

Thanks in advance!

Hi @tohalitv,

No I didn’t and I don’t own the project :slight_smile: That error is okay, you might be missing something in the config.json, but if you try to install it in you cloud sandbox then you can still run the add-on.

Thanks!

Cheers,
Anne Calantog

After you clone the files from atlassian-connect-jira-dashboard-item-example, how can you add into the Gadget list? is there commands or steps to follow? thank you!

Hi @vphung,

After cloning the files from the BB repository:

  1. Make sure you have a cloud sandbox
  2. Install node js in your local machine
  3. Inside the app directory, run npm install to install the app’s dependencies
  4. Still inside the app directory, run node app.js in your terminal to start the app
  5. host your app locally thru ngrok. If your node app is running in 3000, then run ngrok http 3000
  6. Once your ngrok is running, test in your browser if you’re able to access your descriptor by copying the https URL of the ngrok and pasting it on your browser. It should redirect you to your app descriptor URL
  7. Copy the URL in your browser (e.g. https://ngrok/atlassian-connect.json)
  8. In your jira cloud instance, enable the development mode by going to add-ons -> Manage add-ons -> Setup -> Tick the development mode
  9. Refresh your page if your not able to see an ‘install add-on’ link. If you can see this, then paste the descriptor there and that should install the app in your Jira sandbox

Hope this helps.

Cheers,
Anne Calantog

To anyone else who runs into this same problem…

I got the exact same behavior - the add-on got installed but then it was not displayed in the available gadgets list on the Dashboard. In my case, the example included a remote condition, and remote conditions are no longer supported, so Jira silently ignored my dashboard item. I replaced the remote condition with “user_is_logged_in” and it worked. (see Does Jira Cloud no longer support callback-based conditions?)

Hope this helps

1 Like