Customise Word Export Template for Jira Applications

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Background

This KB article outlines how to customise the output from JIRA applications while exporting issues to Word documents.

Resolution

The content on this page includes steps to customize or extend Atlassian software (adding/changing CSS rules, HTML, JavaScript, etc.). Per the Atlassian Support Offerings, support does not include customizations made to Atlassian products. Be aware that this material is provided for your information only and using it is done so at your risk.

If you have any questions about this or any customization, please ask the community at Atlassian Community or consider working with an Atlassian Solution Partner.

  1. The output of word export is controlled by the four velocity templates located at atlassian-jira/WEB-INF/classes/templates/plugins/issueviews located under Jira applications Installation Directory.

    1. single-word-css.vm - Defines the html styles used for export

    2. single-word-header.vm - Defines the header part of the exported document

    3. single-word.vm - The content part of the exported document

    4. single-word-footer.vm - The footer part of the exported document

  2. Open these files in your favorite text editor and make the required changes and save it.

  3. Restart the application.

There is a feature request for this functionality to be handled within the core of Jira applications, as tracked at: JRASERVER-12813 - Export to Word: more control

Example: Changing Word Export to A4 size

  1. Access single-word-css.vm.

  2. Open in a text editor and Add the following css under <style type="text/css">:

    @page

    {

    /The A4 paper size is 210 mm wide by 297 mm long/

    size: 210mm 297mm!important;

    }

  3. Save and restart your JIRA application.

Example: Increase the Character Length of Issue Summary in Issue Export to Word File

Edit the single-word.vm file to increase the length of Issue Summary on each node. There are char limits for some of the items in the template. The default value is 40 chars

1 2 3 <!-- Line 27 ## --> $textutils.htmlEncode($stringUtils.abbreviate($issue.summary, 40)) <!-- Line 367 -->                        <a href="$baseurl/browse/$textutils.htmlEncode($encoder.encode($subTask.key))">$textutils.htmlEncode($stringUtils.abbreviate($subTask.summary, 40))</a>

Change the number of chars to a higher value and restart your nodes to apply the changes.

1 2 3 <!-- Line 27 ##  -->              $textutils.htmlEncode($stringUtils.abbreviate($issue.summary, 100)) <!-- Line 367    -->                     <a href="$baseurl/browse/$textutils.htmlEncode($encoder.encode($subTask.key))">$textutils.htmlEncode($stringUtils.abbreviate($subTask.summary, 100))</a>

You will see more chars from the Summary is added to the Word file. Please see screenshot of Word file export before and after changes applied.

(Auto-migrated image: description temporarily unavailable)

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.