Dashboard gadget: graphical approval visualizations (charts)
Description
Add a single configurable Jira dashboard gadget that presents approvals graphically as charts, complementing the list/detailed gadget (AP-626). One gadget exposes multiple chart types selected in configuration, rather than a separate gadget per chart. Visibility, space scoping, and owner-permissions mode follow the same rules as AP-626.
Chart types (first version)
The gadget supports four chart types, chosen in the gadget configuration:
-
Pending per approver: bar chart of pending approvals per approver within the selected space. Clicking a bar drills down to that approver's pending approvals.
-
Status distribution: breakdown of approvals in the selected space by state (pending / approved / rejected / abstained), as a pie or bar chart.
-
Approvals over time: approvals created and/or resolved per time bucket (e.g. week or month), as a line or bar chart, to show trend and backlog growth.
-
Pending per step: for multi-step approvals, a bar chart of where approvals are currently waiting (which step), to surface bottlenecks specific to the multi-step model.
Each chart supports drilldown to the underlying approvals, opening the same list/detailed presentation used by AP-626 (the two gadgets share the approval presentation layer).
Visibility model (computed server-side, per viewing user)
Chart aggregates must be computed only over the set of approvals the viewing user is entitled to see, using the same rules as AP-626:
-
Global admin or admin of the selected space: all approvals in that space.
-
Regular user: only their own approvals in that space.
This is a hard requirement: a chart must never aggregate or count approvals the viewer could not see as a list. Aggregations are built on the already-permission-filtered set, so the chart cannot become a side channel that reveals counts of approvals the viewer has no access to. JQL (optional) filters only within the already-resolved set; it never widens visibility.
Configuration and persistence
-
Per-instance config: selected space, chart type, optional date range (for time-based charts), optional JQL. Stored in the native gadget configuration (
editview). -
Per-user state (if any): persisted in browser localStorage, keyed per gadget instance (
gadgetInstanceId), consistent with AP-626. The backend does not store user settings.
Optional: shared owner-permissions mode
The gadget supports owner-permissions mode on the same terms as AP-626, so an admin can share a dashboard exposing a whole space's approval charts to users who would otherwise see only their own:
-
Gated by the dedicated custom global permission (
jira:globalPermission), default grantjira-administrators; the per-space admin / global-admin check still restricts configuration to the selected space. -
Scope: exactly one space, optionally narrowed by JQL.
-
Re-validation on every render that the configured owner still has admin rights to the space; otherwise no data is shown.
-
Aggregates are computed under the configured owner's permissions for that space.
-
No anonymous exposure: owner mode never renders chart data for an anonymous viewer (e.g. a publicly shared dashboard).
-
Transparency: the gadget indicates it is showing data shared with the configured owner's permissions.
Voting is not applicable to charts; the drilldown into list/detailed follows AP-626's voting rules, where a vote is cast only by a viewer who is themselves an approver of the step.
Acceptance criteria
-
A single gadget offers four chart types selectable in configuration: pending per approver, status distribution, approvals over time, pending per step.
-
Each chart is scoped to the selected space and respects the viewer's permissions (admin/global-admin sees the whole space; regular user sees only their own approvals).
-
Chart aggregates are never computed over approvals the viewer is not entitled to see.
-
Clicking into a chart drills down to the underlying approvals using the AP-626 list/detailed presentation.
-
Time-based charts honour the configured date range.
-
Optional JQL filters only within the already-resolved set.
-
Per-instance configuration (space, chart type, date range, JQL) is stored in the gadget configuration; any per-user state uses localStorage.
-
Owner-permissions mode works on the same terms as AP-626 (global permission gate, per-space admin check, render-time re-validation, no anonymous exposure, transparency indication).
Notes / open points
-
Confirm available chart-rendering approach within the gadget's custom UI (charting library vs. built-in), consistent with the existing frontend stack.
-
Audit logging for owner-permissions mode (which space's aggregates were rendered, under whose permissions) shares the same open question as AP-626 and may be scoped together.
-
Performance: aggregations over large spaces should be computed efficiently (server-side aggregation rather than pulling all approvals to the client), especially for time-based and per-step charts.