i have been able to add a gadget in the dashboard using REST APIs
url = "https://your-domain.atlassian.net/rest/api/3/dashboard"
and
url = "https://your-domain.atlassian.net/rest/api/3/dashboard/{dashboardId}/gadget"
Once a gadget is added, which REST API to use to populate the gadget?
e.g. i added Filter Count gadget. Now how do i add using REST API
1. filter
2. specify the counts
Hi @Vishal Biyani , I think you will need to use following rest endpoint:
{"key":"config","value":{"filterId":"10004","isConfigured":"true","columnNames":"issuetype|issuekey|summary|priority|customfield_10058","isPopup":"false","num":"10","refresh":"false"}}
@Martin Bayer _MoroSystems_ s_r_o__
i added the dashboard gadget using
url = "https://your-domain.atlassian.net/rest/api/3/dashboard/{dashboardId}/gadget"
got the itemId using =
response.json()["id"]
Now when i try to run below API, replacing dashboardId and itemId received from above
url = "https://your-domain.atlassian.net/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties"
getting 404
b'{"message":"null for uri: https://your-domain.atlassian.net/rest/api/3/10671/items/39921/properties","status-code":404}'
Not sure why is that happening. i even added a sleep of 5 seconds to ensure the gadget is getting added to the dashboard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Martin Bayer _MoroSystems_ s_r_o__
never mind. i had missed dashboard and hence was getting 404 :-(
The issue is resolved now. thanks for your guidance though
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vishal Biyani , sorry for the late reply, but I'm happy that you were able to resolve the problem yourself :)
You can accept the answer if you think it could help other users...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Martin Bayer _MoroSystems_ s_r_o__
I am able to add "Filter Results" gadget using put method.
However, I am struggling to add "Filter Counts" gadget. i am not sure what is the right payload to use.
I tried using two calls with below payload
for projectFilterDetails i used
payload_value={"id": "11860", "type": "filter",}
for countOptions i used
{
"hasTrigger": False,
"trigger":
{
"display": "warning",
"triggerEquality": "above",
"triggerOn": "undefined"
},
"name": "High+ Open",
"jql": "priority in (Critical, High, 'Show Stopper') and status in (Open, 'In Progress')",
"id": "c976"
}
When i call put API i get 201 and i can browse the end point
But on dashboard, the gadget shows error and does not allow me to edit it also.
Any guidance with this will be helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vishal Biyani following PUT works fine for me:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Martin Bayer _MoroSystems_ s_r_o__
Thanks. Based on your response, i debugged further and after fixing the issue related to payload, this works fine.
Is there any place where it is documented what are the various propertyKey available for a gadget?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vishal Biyani , good job :).
Unfortunatelly these keys are not documented because every gadget (even your custom implementation) can contain different properties. That's why there is REST API which will return the properties and you just need to understand how to use the API :).
If my answer was helpful, feel free to accept the answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Martin Bayer _MoroSystems_ s_r_o__
Your guidance was very useful in getting creation of dashboard automated.
Accepted the answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.