Documentation for JIRA 4.3. Documentation for other versions of JIRA is available too.

Skip to end of metadata
Go to start of metadata
Icon

Customisations to Velocity templates or other JIRA files are not included in the scope of Atlassian Support.

Deploying Velocity Templates without a Restart

In a development instance, you can play with picking up velocity file changes without a restart.
From <jira-install>/atlassian-jira/WEB-INF/classes/velocity.properties:

  1. Change class.resource.loader.cache from true to false
  2. Uncomment (remove the # sign from) #velocimacro.library.autoreload=true
Icon

Keep in mind that the next time you upgrade JIRA – or need a new installation for any reason – you will have to manually copy any changes you have made to the JSPs or tempates into the new installation of JIRA. If the JSPs or templates have changed in the newer version, you will have to port your customization into them.

Icon

To change the columns in your filter subscriptions, you don't need to customise the mail templates. See Customising your Issue Navigator.

Icon

There's a feature request to improve this at JRA-7266. Please vote.

JIRA generates emails in reaction to events using a templating engine. The templating engine is Apache Jakarta's Velocity. This is a relatively easy to use templating language that can pull apart java objects in useful ways. The mails are generated inside JIRA by invoking Velocity with a set of objects of relevance to the event.

Email Template Locations

To customise email content, please follow this procedure.

  1. Open up your JIRA distribution, and navigate to the following paths:
    • Standalone: atlassian-jira/WEB-INF/classes/templates/email/
    • Source: jira/src/etc/java/templates/email/
    • WAR: webapp/WEB-INF/classes/templates/email/
  2. Under this directory there are three directories: html, text and subject. The html subdirectory contains the templates used to create emails in html, while the text directory the plain text mail outs. The subject directory contains the templates used to generate the subject of the emails. The templates are named after the event that will trigger the email.
  3. Bring the template up in your favourite text editor. Referring to the JIRA template documentation (particularly Velocity Context for Email Templates) and Velocity Users Guide, make the customisations you want.
  4. Restart JIRA.

For new email templates:

  1. Create your new mytemplate.vm files in the html, text and subject directories, based on the existing files in those directories
  2. Add the templates to atlassian-jira/WEB-INF/classes/email-template-id-mappings.xml to make them valid choices for when you are adding a new event.

Note that since JIRA 4.1 each new template has to have a corresponding file in the subject directory.

Advanced Customisation

The Issue object is passed into the vm templates. Notice some of it's implementation in /includes/summary-topleft.vm. As an example, calling $issue.getProject() would allow you to determine the project an issue comes from, and even create logic to show different information for emails from different projects.