Via XSLT and XSL-FO, very different templates can be created individually. If you know the technology, you have various options to design them. In this documents, you get the basic information to manage this.
JIRA Issues as XML Data
The following example XML document shows you how to edit in your XSLT stylesheet.
<?xml version="1.0" encoding="UTF-8" ?> <issues> <issue> <___ip.key___>KBEP-1</___ip.key___> <___ip.summary___>Swimlanes on Kanban boards</___ip.summary___> <___ip.description___><p><b>HTML-Formatted description</b></p></___ip.description___> <___ip.qrcodeimage___><!-- Base 64 encoded image content --></___ip.qrcodeimage___> </issue> <issue> <___ip.key___>KBEP-2</___ip.key___> <___ip.summary___>The second description</___ip.summary___> <___ip.description___>The second issue</___ip.description___> <___ip.qrcodeimage___></___ip.qrcodeimage___> </issue> </issues>
JIRA fields that can be used within templates
The elements in the issue view, marked with colored circles, are partially part of the existing templates or can be used to create new templates. Apache FOP is used to transform templates in XSL-FO format (in a special XSL style sheet, W3C-Standard) for direct printing or .pdf creation.
Placeholder for JIRA entries for use in templates
You can use the following place holders in the templates for the items marked in the issue view above. To test all fields, the template seibertmedia can be used.
- Issue key (
___ip.key___
) - Summary (
___ip.summary___
) - Description (
___ip.description___
) - Issue type (
___ip.issuetype___
) - Issue type icon (
___ip.issuetypeIcon___
) - Better and bigger Issue type icon (
___ip.issuetypeStyledIcon___
) - Priority (
___ip.priority___
) - Priority Icon (
___ip.priorityAsIcon___
) - Labels (
___ip.labels___
) - Components (
___ip.components___
) - Status (
___ip.status___
) - Fix versions (
___ip.fixVersions___
) - Resolution (
___ip.resolution___
) - Assignee - Username (
___ip.assignee___
) - Assignee - Fullname (
___ip.assigneeName___
) - Reporter - Username (
___ip.reporter___
) - Reporter - Fullname (
___ip.reporterName___
) - Creator - Username (
___ip.creator___
) - Creator - Fullname (
___ip.creatorName___
) - Due date (
___ip.duedate___
) - Original estimated time (time) (
___ip.originalEstimate___
) - Remaining estimated time (time) (
___ip.timeestimate___
) - Time spent (
___ip.timespent___
) - Date created (
___ip.created___
) - Date updated (
___ip.updated___
) - Resolution date (
___ip.resolutionDate___
) - Votes (
___ip.votes___
) - Parent (
___ip.parent___
) - Project name (
___ip.projectName___
)
- Epic link (
___ip.epiclink___
) - Sprint (
___ip.sprint___
) - Story Points (
___ip.storypoints___
) - Rank (
___ip.rank___
)
- URL (
___ip.url___
) - Storypoint color (
___ip.storypointsColor___
) - QR code of URL (
___ip.qrcodeimage___
) - Estimate (SP or hours) (
___ip.estimate___
) - Custom fields
- Pattern:
___ip.customfield_xxx___
xxx
corresponds to numbers, i.e.___ip.customfield_10000___.
- A complete table of all fields can be found on the global configuration page.
- Pattern:
- Issue links
- Pattern:
___ip.issuelinks__direction_inward__[id_xxxxx__maxlength_xx__maxlinks_x]___
- argument
direction
is required; specify the link direction of the issue links; options: inward, outward - argument
id
is optional; filter to a specific issue link type; the issue link type id - argument
maxlength
is optional; limit the length of the issue link description; number of allowed letters - argument
maxlinks
is optional; limit the number of issue links; maximum number of issue links
- Pattern:
Custom template examples
4 issues on one A4 page
The first thing to ajust is the default paper format: Change it to A4 landscape within <fo:simple-page-master>. Then define two columns in the Tag <fo:region-body>:
<fo:layout-master-set> <fo:simple-page-master master-name="A4-landscape" page-height="21cm" page-width="29.7cm" margin="0.5cm" margin-top="0.3cm"> <fo:region-body margin="5mm 0mm 5mm 0mm" column-count="2" column-gap="4mm" /> </fo:simple-page-master> </fo:layout-master-set>
The next think to ajust is <page-sequence>:
<fo:page-sequence master-reference="A4-landscape" font-family="'DejaVu Sans'" font-size="10pt"> <fo:flow flow-name="xsl-region-body"> <xs:apply-templates select="//issue" /> </fo:flow> </fo:page-sequence>
Then use the xsl template definition <template match="issue"> to rint your specific issue layout.
Please see the complete XSL file for a working example: FourOnA4.xsl
Changing the paper format
Download a template from the "InstaPrinta Global Configuration" page and open it with a text-editor of your choice. Now jump to the 10th line and customize the paper format:
page-height="10.5cm" page-width="14.8cm" margin="0.5cm" margin-top="0.5cm">
Instead of cm (centimeters) you can also use in (inches).
Upload the template under a new name and that's it.
Inserting blank lines
Insert the following code block to create blank lines:
<fo:block>
<fo:leader />
</fo:block>