JIRA Charts Macros

Last modified by Simon Urli on 2025/02/03 10:41

cogDisplay charts reusing JIRA statistics
TypeJAR
CategoryMacro
Developed by

Vincent Massol, Simon Urli, Teodor Caras, XWiki Development Team

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

XWiki 14.10.21+

Installable with the Extension Manager

Description

This extension provides a set of macros allowing to display charts and table for displaying statistics based on JIRA information.

Pie Chart

This macro allows to display a pie chart representing a single data information on a set of JIRA ticket. 

The following parameters are mandatory:

  • the JIRA instance identifier (see JIRA Administration) or the JIRA URL 
  • the query for the list of tickets or a filter identifier
  • the type of data to display among the following set: status, fix version, assignee, priority, component, issue type.

There is also an optional parameter allowing to define the maximum number of data to be displayed in the pie chart (default is 10).

## usage example with mandatory parameters
{{jiraPieChart type="STATUS" URL="https://jira.xwiki.org" query="project=XWIKI"/}}

## with optional parameter
{{jiraPieChart type="STATUS" URL="https://jira.xwiki.org" query="project=XWIKI" maxData="3"/}}

## using instance id and filter id
{{jiraPieChart type="ASSIGNEE" id="xwikiorg" filterId="16802"/}}

Created vs Resolved Chart

This macro allows to display a line chart displaying comparison between created and resolved tickets.

The following parameters are mandatory:

  • the JIRA instance identifier (see JIRA Administration) or the JIRA URL 
  • the query for the list of tickets or a filter identifier
  • the number of days to look in the past for the data
  • the period of time used to gather the data (hourly, daily, weekly, monthly, quarterly, yearly)

The macro also supports those optional parameters:

  • count each data once or accumulate the values
  • display trend 
  • display versions (TODO: this option is available but doesn't have any effect yet)
## usage example with mandatory parameters
{{jiraCreatedVsResolvedChart daysPreviously="30" period="DAILY" URL="http://jira.xwiki.org" query="project=XWIKI"/}}

## usage example with optional parameters
{{jiraCreatedVsResolvedChart daysPreviously="500" period="MONTHLY" URL="http://jira.xwiki.org" query="project=XWIKI" displayTrend="true" displayVersion="ALL"/}}

BiDimensional Grid

This macro allows to display a table displaying tickets information based on two chosen criteria.
The following parameters are mandatory:

  • the JIRA instance identifier (see JIRA Administration) or the JIRA URL 
  • a filter identifier (note: it's not possible to use a JIRA query for this specific macro)
  • the criteria displayed in each row, one of the following field: assignee, reporter, status, fix version, component, priority, type
  • the criteria displayed in each column, one of the following field: assignee, reporter, status, fix version, component, priority, type

The macro also supports those optional parameters:

  • a maximum number of results to display (default is 5)
  • sort ascending or descending (default is ascending)
  • sort using totals or order coming from JIRA request (default use order coming from JIRA request)
## usage example with mandatory parameters
{{jiraBiDimensionalGridChart xAxisField="ASSIGNEE" yAxisField="COMPONENT" URL="https://jira.xwiki.org" filterId="filter-16802"/}}

## usage example with optional parameters
{{jiraBiDimensionalGridChart xAxisField="FIX_VERSION" yAxisField="REPORTER" URL="https://jira.xwiki.org" filterId="filter-16802" numberOfResults="10" sortAscending="false" sortNatural="false"/}}

Troubleshooting & Limitations

 

JIRA Query and Filter ID

Pay attention that the BiDimensional grid macro doesn't support using JIRA query, but only filter id. Also, right now there's a difference in the format of filterId used in this macro and in the other macros: for the BiDimensional grid macro the filterId needs to be prefixed with filter-. See also https://jira.xwiki.org/browse/JIRA-68 

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.

Dependencies

Dependencies for this extension (org.xwiki.contrib.jira:jira-macro-charts 10.1.1):

  • org.xwiki.contrib.jira:jira-macro-default 10.1.1
  • org.xwiki.contrib:application-chartjs-ui 1.6.3
  • org.xwiki.contrib.jira:jira-macro-common 10.1.1
  • org.xwiki.platform:xwiki-platform-localization-api 14.10.20

Get Connected