How to develop a Gadget for JIRA Cloud instance

We are using JIRA Cloud for Silverpeak to manage Issues and Test Executions.

Now, we want to create a new Gadget to calculate the quantity of Test Executions by status (pass, fail, wip, blocked and unexecuted) and show them on a Pie chart. This gadget needs at least one parameter: ZQL Filter Query. With this gadget, QA Tester can run a Python script (calling “/rest/api/2/dashboard”) to add this gadget to JIRA Cloud dashboard. As of writing this topic, this script already can successfully add a Gadget of “Test Execution Details” to dashboard; However, Besides the detailed information, QA Tester also wants a summary result shown in Pie chart.

Th following tutorial:

https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project/create-a-helloworld-plugin-project?_ga=2.248608835.597535794.1511150607-1956449028.1511150607

lets me know how to create a gadget, so I install Atlassian Plugin SDK and take a try.

Robert Massaioli told us this SDK is only for Atlassian Server development, see the following topic

So, I follow the guides:

https://developer.atlassian.com/cloud/jira/platform/getting-started/
https://developer.atlassian.com/cloud/jira/platform/build-a-jira-app-using-a-framework/

and successfully create “Greating” and “Hello Word” on navigation bar on my developing JIRA Cloud instance.

I find the following description:
https://developer.atlassian.com/cloud/jira/platform/extending-the-user-interface/

Dashboard items: allows apps to provide a gadget to display on Jira Cloud dashboards.

So far, I can’t find any detailed information for how to develop a Gadget for JIRA Cloud instance.

Would anybody like to tell us how to do this, is there an example with being similar to requirement, or where I can find any detailed guide.

Any helps or suggestions will be appreciated.

Here, thanks Robert Massaioli again for his worth reply.

Best wishes.

BTW, our Python script calls JIRA REST api and Zephyr Cloud REST API.

There is a Atlassian Connect Dashboard Item Example, and some documentation on Dashboard Items.

Thank David for your quick reply.

I successfully register this add-on into my developing JIRA Cloud instance (https://xinzhijiang.atlassian.net), and I can see it on Manage add-ons page; But this add-on can not be listed when I click Add a new gadget on a dashboard. I hope it appears on the list of Add a gadget page, For this purpose, what should I do?

I am trying another example:

https://developer.atlassian.com/static/connect/docs/latest/tutorials/project-activity-tutorial.html.

Best wishes.

The dashboard item’s availability is controlled via the add-on’s descriptor. If you are still having trouble, you could show the content of the add-on descriptor here.

Hi David,

This is my add-on which was built based on Atlassian Connect Dashboard Item Example, this add-on still can not be listed when I click add a new gadget on a dashboard.

The following is my atlassian-connect.json:

{
“key”: “com.silverpeak.executions.summary”,
“name”: “Test Executions Summary”,
“description”: “Display the summary of Test Executions in Pie chart”,
“vendor”: {
“name”: “Atlassian”,
“url”: “http://www.atlassian.com
},
“baseUrl”: “{{localBaseUrl}}”,
“links”: {
“self”: “{{localBaseUrl}}/atlassian-connect.json”,
“homepage”: “{{localBaseUrl}}/atlassian-connect.json”
},
“authentication”: {
“type”: “jwt”
},
“enableLicensing”: false,
“lifecycle”: {
“installed”: “/installed”
},
“modules”: {
“jiraDashboardItems”: [{
“name” : {
“value” : “Test Executions Summary”,
“i18n” : “issues.in.project.i18n”
},
“url” : “/issues-in-project?dashboard={dashboard.id}&dashboardItem={dashboardItem.id}”,
“key” : “iframe-requests”,
“description” : {
“value” : “Display the summary of Test Executions in Pie chart”,
“i18n” : “issues.in.project.description.i18n”
},
“thumbnailUrl”: “/thumbnail”,
“configurable” : true,
“conditions” : [{
“condition”: “/condition?view={dashboardItem.viewType}&dashboard={dashboard.id}&dashboardItem={dashboardItem.id}”
}]
}]
},
“scopes”: [“READ”, “WRITE”]
}

please take a look and give me some helps,

Thanks a lot.

Were you able to find any additional information? I’m having a hard time finding up-to-date examples for cloud.

I think your "conditions" value may be to blame. A dashboard item will only be available when all of its conditions are satisfied. The condition you’ve specified appears to be a relative URL, and I don’t believe that’s a valid way to specify a condition.

See the Conditions page of the Jira Cloud Platform documentation.

Also check that the relative URL /thumbnail returns a valid png or gif image.

For reference, here is the dashboard item module that we use in Risk Register:

"jiraDashboardItems": [
  {
    "key": "dashboard-risk-matrix",
    "name": {
      "value": "Risk matrix"
    },
    "description": {
      "value": "Risk matrix dashboard item"
    },
    "url": "/dashboard-risk-matrix?dashboardId={dashboard.id}&dashboardItemId={dashboardItem.id}",
    "configurable": true,
    "thumbnailUrl": "/assets/images/rrlogo128x64.png"
  }
],