Important note Retirement of icTime and Retirement of biz on December 29th, 2023

Custom Reports enhanced


General idea - using Jasper Reports with icTime

Prerequisites

  • You should have a report design tool to build Jasper Reports jrxml files. We suggest to usen either the standalone Jasper Studio Designer or the Eclipse Plugin to build Jasper reports.
  • You should have access to a JIRA Installation with icTime time tracking plugin installed, Version 5.8.2 or later
  • We recommend using a copy of your production database while developing reports.

Introduction

icTime expects a zip archive containing all files required to fill and execute a report. The archive must contain a file named main.jrxml. This file is compiled and "filled" during report execution. Usage of style sheets (jrtx files) and Jasper Sub Reports is supported as well, but must meet some conventions to be executable in your target JIRA installation.

Starting point

  • Download the examples we provide on our website or install the samples bundled in the plugin. Examples are available for the following databases:
    • MySQL
    • PostgreSQL
    • MSSQL
    • Oracel
  • Test the example(s) in your JIRA/icTime installation
  • For development of your own reports
    • Unzip and explore the example  filles (download sources from our website)
    • Test main.jrxml file in your Report Designer using the Jasper Reports preview option
    • Rebuild the archive 
    • Deploy your test archive and test it in your Jira/icTime environment

Step by Step Explanation

  • Download the source of the sample02: sample02_barchart_ict582-src.zip
  • Extract example sample02_barchart_ict582-src.zip

You will get a structure like this:

Files & Usage

FilePurposeRemarks
build_sample02.shBuild file (Linux) to create the executable Report archive (ictime_sample02.zip)

Steps done by build_sample02.sh:

  • rm ictime_samle02.zip
  • cp main_sample02.jrxml to main.jrml
  • create zip archive named ictime_sample02.zip with files
    • main.jrxml
    • iconcept_logo.png
    • jr_sample_styles_ic_v10.jrtx
  • removes main.jrxml
iconcept_log.pngThe picture (corporate logo) used in the report
ictime_sample02.zipThe ready to run zip ArchiveReady to upload report zip archive
jr_sample_styles_ic_v10.jrtxSample style sheet file used in the main report file
main_sample02.jasperCompiled version of main_sample02.jrxml
main_sample.jrxmlMain report file

Features used:

  • show usage of worklog_id parameter (provided by icTime in report query by result set of filtered and displayed Worklogs)
  • show usage of style sheet file in execution environment (unix based target envrionment)
  • show simple details table
  • show usage of a chart using main dataset


icTime expects the main report file to be saved as "main.jrxml" in the zipped report archive. On linux systems you can use the build script (build_sample_xx.sh) to create your archive. 


Installing samples from the plugin

Samples for all supported databases are shipped with the plugin.

You can install the plugins using the "Install samples Button" from icTime Administration => Custom Reports view


Downloding samples

Direct usable samples (zip files only) - click on zip file to download:

NameDescriptionfor MySqlPostgresMsSqlOracle
sample01

Report, using sub reports to show time worked by

  • Project
  • Activity
  • Team
Sample 01 (mysql)Sample 01 (postgres)Custom Report Sample 01 (MsSql)Sample 01 (Oracle)
sample02Report, showing time worked grouped by user and daySample 02 (mysql)Sample 02 (postgres)Custom Report Sample 02 (MsSql)Sample 02 (Oracle)

Full source sample files (for developing own reports)

NameDescriptionfor MySqlPostgresMsSqlOracle
sample01

Report, using sub reports to show time worked by

  • Project
  • Activity
  • Team
Sample 01 MySqlSample 01 PostgresSample 01 MsSqlSample 01 Oracle
sample02Report, showing time worked grouped by user and daySample 02 MySql2Sample 02 PostgresSample 02 MsSql

Sample 01Oracle

Remarks - Postgres

It is not possible to preview the sample reports in Jasper Studio, due to a missing auto type conversion in psgl. To test report, remove "$X(in,...)" from the where condition in the report while testing. Insert the condition afterwards.

Parameter usage

Parameter namePurposeJRXML-Source code
EXEC_DIRECTORY_hiddenPopulated during execution from icTime (no action needed by the user).
Contains the directory where the report is executed

<parameter name="EXEC_DIRECTORY_hidden" class="java.lang.String">
<parameterDescription><![CDATA[Execution Directory]]></parameterDescription>
<defaultValueExpression><![CDATA["./"]]></defaultValueExpression>
</parameter>

worklog_idContains the list (Collection of Integers) when executed from Timesheet or Reporting.
This list will be automatically provided by icTime base on the selection you run your Reporting.

<parameter name="worklog_ids" class="java.util.Collection">
<parameterDescription></parameterDescription>
<defaultValueExpression></defaultValueExpression>
</parameter>

SUBREPORT_DIR

If present and empty: icTime populates parameter with directory where the report is executed.

  • use this, if your main report uses sub reports (see example Sample 01)


Supported Parameter Types

The following data types are supported during report execution in JIRA / icTime. 

Report Parameter Data TypePrompt on executionRemarks
Long(plus)
Integer(plus)
BigDecimal(plus)Use "." as decimal delimiter. No grouping supported (e.g. 123500.23)
Date(plus)

With Date picker according to your individual date format settings

java.util.CollectionNumber values only

Example:

Entering 123,125,130
will be converted in a collection.
Each value will be converted to a Long


Uploading a report (Custom Reports)

Navigate to ictime / Administration /Custom Reports and click on Create.
The following screen will appear:

Fields & Explainations

FieldChange value
allowed after creation?
Description
Name(minus)The name of the report. Will be shown in timesheet / reporting if applicable
Description(plus)Put any meaningfull description in here (e.g. Version of the report, content of the report)
Locale(plus)During execution of the report (on your target system), localization of Dates and numbers will be done using the locale of the target environment by default.
If you need a specific locale in the report, than you can use the locale setting here. It is passed as REPORT_LOCALE parameter to the report.

Type(minus)

Report result type(plus)Only applicable for report type "general". Defines the target of the report.
Disabled(plus)Once this option is selected, the report will not be shown any longer in timesheet / reporting and is no longer usable for invoicing
Show in reporting(plus)Option to allow/disallow report execution from icTime reporting page
Show in timesheet(plus)Option to allow/disallow report execution from icTime timesheet page


Execution restriction

To be able to execute any report, you need either to have the Custom Report administration permission OR at least the Custom Report execution permission.

Executing a report

From the Custom Report List

Go to ictime / Administration / Custom Reports.
You will get a list of all Custom Reports available:

Use the "Exec" link in the most right column to run a specific report.

This will show a dialog prompting for the parameters which are defined in the report.

All parameters are displayed in a form using the parameter name as label. Submit the form by pressing the "Execute" button.

Execution from Timesheet or Reporting view

Run a search from the Timesheet or Reporting view. The result of the search is a list of work logs meeting your search criteria. 

Select the report you want to run on the resulting Issues/Work logs from the dropdown "Export (CR)". This will open the report execution dialog. The parameter (worklog_ids) - if defined in the report - is pre-populated with the complete list of work log ids returned by your search.

If you want run a Custom Report in a specific context like ictime Reporting or Timesheet, please process in this order: Apply your filters, run your query (i.e. in Reporting by "Create Report") and then trigger your Custom Report via click on "Export (CR)" (available only if Custom Reports are available/installed, works with sample reports).


Sample output:








Working with sub-reports

  • How to build jasper files from jrxml in Eclipse
    • Use your report project
    • Remove automatic build:  setting in Project => Build Automatically (uncheck checkbox)
    • Run build all from Project menu - for project reportsIcTime
      • This should build the compiled report files in your reportsIcTime Project. As this is linked to IcTime, you are good!
      • There is no need (never do this) to add compiled files in SVN. Only put source files in there .

Fonts

If you want to use special fonts, we recommend to use a style sheet file to have a single place, where you maintain your font definitions.

The font you are using on your report design system (if this differs from your production machine) may NOT be available in the JIRA / icTime execution environment. If the font is not available report execution may fail!

Adding fonts to your Server Installation

Check if a specific font is available in your JIRA Installation

All available fonts are listed below the report list in the icTime => Administration : Tab Custom Reports

If the font is shown in the list and is not usable, than you are missing the logical to physical font mapping. Consider to use a a font manager library on system level (e.g. libfontconfig).

If you want to manual add the font to manually to the JVM / JRE provided by Jira /  Atlassian, consider the documentation provided from Oracle : https://docs.oracle.com/javase/8/docs/technotes/guides/intl/fontconfig.html

The fonts listed show ONLY fonts available on your system. Please do not forget to register the fonts.


Make fonts available to JasperReports - Registration of fonts

Create a font extension including all fonts you require archive usable by JaserReports and provide the jar archive in your Jira Installation directory in the lib subfolder (e.g. /opt/atlassian/jira/lib/).


Structure of the jar extension is:

  • jasperreports_extension.properties
  • yourFontDefintion.xml
  • FONT_SUB_FOLDER
    • fontfile_1.ttf
    • fontfile_2.ttf
    • ....

You should NOT use font.xml as font file definion name. This collides (may collide) with the font definiton provided in the default JRE provided by Atlassian.

Contents of jasperreports_extension.properties

net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.registry.factory.simple.font.families=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.MyFont=YOUR_FONT_DEFINTION_FILE_NAME


Permissions

Permissions considered for Custom Reports. 

PermissionDescriptionRemarks
Custom Reports
  • View Custom Reports:
    • allow create, update and delete of Custom Reports
    • allow execution of Custom Reports
  • My Timesheet 
    • allow execution of reports enabled for timesheet view
  • Reporting
    • allow execution of reports enabled for reporting view

Custom Reports - Execute
  • My Timesheet 
    • allow execution of reports enabled for timesheet view
  • Reporting
    • allow execution of reports enabled for reporting view
Starting from 5.8.2.6

Please find details for administrating permissions here.


Compatibilty

icTime VersionJasper Report VersionRemarks
5.8.2.x -6.5.0we recommend to keep the jrxml file compatible to Jasper Report Version 6.3.0


Exchanging the report engine

You may change the reporting engine by changing the the corresponding Jar archive in icTime plugin using a binary compatible version. Support for patched icTime plugins is not be provided.