My goal is to create dashboard gadgets automatically and programatically. I tried to create dashboard gadget, filter results, using jira rest api. However, there isn't any parameters to set 'saved filter', 'Number of results' or 'Columns to display' for gadget in api ('add gadget to dashboard', 'update gadget to dashboard'). The only thing I can do with api is create an empty gadget.
How can I configure gadgets using api? If it isn't possible, any alternative solution or workaround?
Hi @EddieCM_Chuang ,
welcome to the Atlassian community!
You should use the following rest api https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-dashboards/#api-rest-api-3-dashboard-dashboardid-items-itemid-properties-propertykey-put in order to setup a gadget on a dashboard using api.
Hope this helps,
Fabio
Thanks a lot! I will study the dashboard item.
I'm curious about why Jira provides the rest api to add/update gadgets, but not to configure gadgets.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for @Fabio Racobaldo _Herzum_ suggestion.
My python implementation using jira api `set dashboard item properties`.
payload = json.dumps({
"filterId": "10711",
"num": "50",
"columnNames": "issuetype|summary|issuekey",
"refresh": "true",
"isConfigured": "true"
})
res = requests.request(
"PUT",
f"{HOST}/rest/api/3/dashboard/{dashboard_id}/items/{item_id}/properties/config",
headers={
"Accept": "application/json",
"Content-Type": "application/json"
},
data=payload,
auth=HTTPBasicAuth(EMAIL, TOKEN)
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.