Report Plugin Module

Purpose of this Module Type

A report plugin module defines a report within JIRA. A JIRA report can display statistical information based on all elements within JIRA - e.g. issues, projects, users, issue types, etc.Reports have HTML results and (optionally) Excel results as well. These results are rendererd by Velocity templates included with the plugin. A report can also accept parameters selected by the user before running.


The root element for the report plugin module is report. It allows the following attributes and child elements for configuration:







The class which implements this plugin module. The class you need to provide depends on the module type. For example, Confluence theme, layout and colour-scheme modules can use classes already provided in Confluence. So you can write a theme-plugin without any Java code. But for macro and listener modules you need to write your own implementing class and include it in your plugin. See the plugin framework guide to creating plugin module instances. The Java class of the component. The class must implement, but we recommend that you extend the convenience class in your plugin.



The unique identifier of the plugin module. You refer to this key to use the resource from other contexts in your plugin, such as from the plugin Java code or JavaScript resources.

<component-import key="appProps" interface="com.atlassian.sal.api.ApplicationProperties"/>

In the example, appProps is the key for this particular module declaration, for component-import, in this case.

That is, the identifier of the component.



The localisation key for the human-readable name of the plugin module.


The human-readable name of the plugin module. That is, the human-readable name of the component.

The plugin key.






A human-readable description of this report module. May be specified as the value of this element for plain text or with the key attribute to use the value of a key from the i18n system.



The user-visible name of this report. May be specified as the value of this element for plain text or with the key attribute to use the value of a key from the i18n system.

resource type="velocity"


Used to render the report results. The results format is whatever the template can output.

resource type="18n"

A Java properties file within the plugin that specifies internationalization values.


Used to generate the report's configuration parameters (see Configuring Plugins with Object Configurable Parameters for details on these properties). Note: In JIRA 5.2.3 or later, when navigating to this report via Browser Project, there is are additional URL parameters of projectOrFilterId (project id prefixed with 'project-') and projectOrFilterName (which in this case is the project name). If you have a custom project picker inside your properties / configure page, you should respect these URL parameters pre-select the project.


In order to make a custom report available within JIRA, it is necessary to create a report plugin module. As with all plugin modules, the report plugin will consist of the following components:

  • Java classes encapsulating report logic
  • Resource templates for display of the report
  • Plugin descriptor to enable the report module in JIRA

all contained within a single JAR file.

Report Logic

The Java classes include the necessary logic to retrieve the data used in configuring and displaying the report. The module class can implement the Report interface or it can extend AbstractReport . The main methods of interest are:

  • generateReportHtml - generate HTML view of report
  • generateReportExcel - generate Excel view of report
  • getParams - retrieve the required data to be passed to the view template
  • validate - validate any parameters used in configuring the report

Resource Templates

The second component consists of Velocity templates used to render the report. The templates include:

  • Report view - the actual report view
  • Excel view - an Excel view for the report (optional)

The plugin system parses the atlassian-plugin.xml file for any configuration parameters associated with the report - parameters required in order to display the report. The plugin system constructs a suitable configuration screen requesting the user to specify values for these parameters.

If an Excel view template is provided, users have the ability to view and further manipulate the data through Excel. If the Excel template is provided please ensure that your report also implements the following method:

public boolean isExcelViewSupported()
    return true;


It is also possible to include i18n property files to allow other users to easily translate the strings used in the report for different languages.


This example is taken from JIRA's internal time tracking report.

<report key="time-tracking" name="Time Tracking Report"
    <description key="report.timetracking.description">
        This report shows the time tracking details for a specific project.

    <!-- the label of this report, which the user will use to select it -->
    <label key="report.timetracking.label" />

    <!-- the 'view' template is used to render the HTML result -->
    <resource type="velocity" name="view"
        location="templates/plugins/jira/reports/time-tracking-report.vm" />
        The 'excel' template is used to render an Excel result.
        The 'Excel view' of the report will only be visible if
        this template exists for the plugin module
    <resource type="velocity" name="excel"
        location="templates/plugins/jira/reports/time-tracking-report-excel.vm" />

    <!-- this is a .properties file containing the i18n keys for this report -->
    <resource type="i18n" name="i18n"
        location="com.atlassian.jira.plugins.reports.timetracking" />

    <!-- the properties of this report which the user must select before running it -->
            <!-- valid types are string, text, long, select, date -->
            <!-- the values generator is a class which will
            generate values for this select list -->
            <values class="com.atlassian.jira.portal.VersionOptionalValuesGenerator"/>
            <values class="com.atlassian.jira.portal.SortingValuesGenerator"/>
            <values class="com.atlassian.jira.portal.FilterValuesGenerator"/>

In this example, the report logic is encapsulated in the TimeTrackingReport Java class, the view template location is specified in the templates/plugins/jira/reports/time-tracking-report.vm directory and the internationalisation property files are located at com.atlassian.jira.plugins.reports.timetracking. Following that, the parameters required to configure the report are specifed - in this case, the version, the sort order and a filter.


For more details, see the tutorial on creating a JIRA report.

Was this page helpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport