How to get dashboard and its gadget data and show in confluence page using Forge app
Asked by Arun:

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


Answers:
author: Nikola Perisic
body: Heya [@Arun](/t5/user/viewprofilepage/user-id/5358631) ,

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

comments: author: Arun
body: Heyy [@Nikola Perisic](/t5/user/viewprofilepage/user-id/5166624)  
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.*


author: Nikola Perisic
body: Hey [@Arun](/t5/user/viewprofilepage/user-id/5358631)

Yeah for Forge apps, you need to add some additional permissions and scopes![Screenshot 2024-01-04 at 09.30.13.png](https://community.atlassian.com/t5/image/serverpage/image-id/298849iA96A8C0F933AFEF8/image-size/large?v=v2&px=999 "Screenshot 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/>


author: Arun
body: Heyy [@Nikola Perisic](/t5/user/viewprofilepage/user-id/5166624) ,   
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.


author: Nikola Perisic
body: Hey [@Arun](/t5/user/viewprofilepage/user-id/5358631) ,

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.


author: Arun
body: Hey [@Nikola Perisic](/t5/user/viewprofilepage/user-id/5166624)   

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

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/299030i530FDD00C78AC391/image-size/large?v=v2&px=999 "image.png")  

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


author: Nikola Perisic
body: Hey [@Arun](/t5/user/viewprofilepage/user-id/5358631)

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](https://community.atlassian.com/t5/image/serverpage/image-id/299041iB35E5041139653AF/image-size/large?v=v2&px=999 "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.


author: Arun
body: Hey [@Nikola Perisic](/t5/user/viewprofilepage/user-id/5166624) ,  

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?


author: Nikola Perisic
body: Hey [@Arun](/t5/user/viewprofilepage/user-id/5358631) ,

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


author: Arun
body: Hey [@Nikola Perisic](/t5/user/viewprofilepage/user-id/5166624)   

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

<br />


author: Nikola Perisic
body: Hey [@Arun](/t5/user/viewprofilepage/user-id/5358631) ,

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


author: Arun
body: Hey [@Nikola Perisic](/t5/user/viewprofilepage/user-id/5166624)   

<br />

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](https://community.atlassian.com/t5/image/serverpage/image-id/299121iDA89BD7B53108715/image-size/large?v=v2&px=999 "image.png")


Tags: cloud

confluence-cloud

dashboard

jira-software