How to get dashboard and its gadget data and show in confluence page using Forge app

Arun December 27, 2023

    Does anyone how to get dashboard and its gadget data and display the dashboard and it's gadget on the Confluence page using Forge app

1 answer

1 accepted

0 votes
Answer accepted
Nikola Perisic
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 28, 2023

Heya @Arun ,

You can do this by using the Jira API for dashboards. It has Forge code for dashboards as well.

You can find it here: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-dashboards/#api-group-dashboards

Cheers,

Nikola

Arun December 29, 2023

Heyy @Nikola Perisic
   Have checked the Jira API for dashboard you have mentioned and I have utilized this API to get all dashboards: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-dashboards/#api-rest-api-3-dashboard-get

We trying to display the dashboard using the Forge app on the confluence page, I'm getting this error on the page 'For this app to display, you need to allow the app to access Atlassian products on your behalf'

Do you know how to resolve this issue. Can't I access the Forge App that I have installed on the Atlassian product for a specific site URL.

Nikola Perisic
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 4, 2024

Hey @Arun 

Yeah for Forge apps, you need to add some additional permissions and scopesScreenshot 2024-01-04 at 09.30.13.png

Now for Confluence, all of the scopes you can find on this page: https://developer.atlassian.com/platform/forge/manifest-reference/scopes-product-confluence/

Arun January 4, 2024

Heyy @Nikola Perisic , 
    Have updated the scopes you have mentioned in the manifest of Forge app, and deployed and installed the app on both Confluence and Jira. 

 I am getting the below error:
"errorMessages": [
"The app is not installed on this instance."
]

Do you have any idea how to resolve this issue. 

Nikola Perisic
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 4, 2024

Hey @Arun ,

Yes, after the deployment, you need to use forge install command. From there you need to enter your Jira instance website. 

Tip: When you need to make the frequent changes in the app, use the forge tunnel command, which will update your app with every change that you make in your code.

Arun January 4, 2024

Hey @Nikola Perisic 

as you mentioned above changes have done on my code still can't get the success logs on rest api.

image.png

this my forge code am getting this type response while deployed on server.

Nikola Perisic
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 5, 2024

Hey @Arun 

In the logs I see the 403 forbidden access. Not sure why is this showing to you.  Also another thing

Screenshot 2024-01-05 at 09.32.26.png

You need to fill out these required fields (expand the arrows for required fields). Another strange thing is that it isn't asking for an API key, so how does it know where to create the dashboard.

Have you tried using python instead? Since it asks for API key, which seems reasonable.

If you have trouble, I would also recommend using Postman, it helped me to create a dashboard.

Arun January 5, 2024

Hey @Nikola Perisic ,

Thanks for the replying,

             Am also tried with postman it getting success response only thing is when we tried to run on the server it getting error logs don't know how to rectify it. Have you ever implemented the rest dashboard Api in your forge app is getting response if you done?

Nikola Perisic
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 5, 2024

Hey @Arun ,

Not with Forge, only with the Postman. And this was actually for the cloud. So, you are using int for the server?

Arun January 5, 2024

Hey @Nikola Perisic 

My requirement is to display the dashboard gadget's in confluence page therefore we trying to get the dashboard api details through forge app.


Nikola Perisic
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 5, 2024

Hey @Arun ,

If you need to get the data, you should be using the GET method instead

Arun January 5, 2024

Hey @Nikola Perisic 


I have attached the work image that's what am trying with NodeJS on that time. I had tried with the forge app using the get api also getting the same error .
image.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events