Customized JIRA email templates not usable after upgrade from 5.2.4 to 6.1.6

Hi all,

I'm using test enviroment to upgrade out JIRA from 5.2.4 to 6.1.6.

One of the issues I'm facing is that customized email templates are not working anymore after upgrade. Where can I find updated version of the guide for customizing JIRA email content?

Or if anyone can point me to the right template to use for custom fields?

Here is the example file address.vm:

#disable_html_escaping()
#if ($issue.getCustomFieldValue("customfield_10803"))
<tr valign="top">
    <td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 10px 10px 0;white-space:nowrap;">
        <strong style="font-weight:normal;color:${textSubtleColour};">#text("Address"):</strong>
    </td>
    <td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;">
        $issue.getCustomFieldValue("customfield_10803")
    </td>
#end
</tr>

And my issuecreated.vm, where I parsed custom tempaltes:

#disable_html_escaping()
#parse("templates/email/html/includes/emailconstants.vm")
#parse("templates/email/html/includes/header.vm")
<tr valign="top">
    <td id="email-banner" style="padding:32px 32px 0 32px;">
        
        #if ($issue.reporterUser)
            #set ($reporter = "#authorlink2($issue.reporterUser.name $linkstyle)")
        #else
            #set ($reporter = "#text('common.concepts.no.reporter')")
        #end

        #set ($issueType = $issue.getIssueTypeObject())

        #set ($issueLink = "#renderIcon(${issueType.iconUrlHtml} ${issueType.getNameTranslation($i18n)}) <a style='color:${textLinkColour};text-decoration:none;' href='${baseurl}/browse/${issue.getKey()}'>$issue.getKey()</a>")

        #emailbanner($issue.reporterUser "email.event.activity.created" $reporter $issueLink "")
    </td>
</tr>
<tr valign="top">
    <td id="email-fields" style="padding:0 32px 32px 32px;">
        <table border="0" cellpadding="0" cellspacing="0" style="padding:0;text-align:left;width:100%;" width="100%">
            <tr valign="top">
                <td id="email-gutter" style="width:64px;white-space:nowrap;"></td>
                <td>
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        #parse("templates/email/html/includes/fields/issuetype.vm")
                        #parse("templates/email/html/includes/fields/affectsversions.vm")
                        #parse("templates/email/html/includes/fields/assignee.vm")
                        #parse("templates/email/html/includes/fields/attachments.vm")
                        #parse("templates/email/html/includes/fields/components.vm")
                        #parse("templates/email/html/includes/fields/createddate.vm")
						#parse("templates/email/html/includes/fields/requester.vm")
						#parse("templates/email/html/includes/fields/city.vm")
						#parse("templates/email/html/includes/fields/address.vm")
						#parse("templates/email/html/includes/fields/phone.vm")
						#parse("templates/email/html/includes/fields/mobile.vm")
                        #parse("templates/email/html/includes/fields/description.vm")
                        #parse("templates/email/html/includes/fields/duedate.vm")
                        #parse("templates/email/html/includes/fields/environment.vm")
                        #parse("templates/email/html/includes/fields/fixversions.vm")
                        #parse("templates/email/html/includes/fields/project.vm")
                        #parse("templates/email/html/includes/fields/labels.vm")
                        #parse("templates/email/html/includes/fields/priority.vm")
                        #parse("templates/email/html/includes/fields/reporter.vm")
                        #parse("templates/email/html/includes/fields/securitylevel.vm")
                        #parse("templates/email/html/includes/fields/timetracking.vm")
                    </table>
                </td>
            </tr>
        </table>
    </td>
</tr>
#parse("templates/email/html/includes/footer.vm")

4 answers

1 accepted

0 vote
Henning Tietgens Community Champion Jan 21, 2014

I think, you should take a look at the differences between your templates and the ones provided with the system. There were some changes in the user handling from 5.x to 6.x, maybe there is a problem. E.g the line "#if ($issue.reporterUser)" is now "#if ($issue.reporterId)".

On the page https://developer.atlassian.com/display/JIRADEV/Development+Resourcesyou find pages to information for developers about the changes made to the system.

Henning Tietgens Community Champion Jan 21, 2014

A best practice for me for release changes is to implement the changes made into the templates provided with the software and not use the old templates.

how to change the color of hyperlinks in email templates.We had dark blue color in 6.0.8 and now in 6.2.5 it is sky blue color,how can I change it?

There's BotoCssInliner, which job is to take rules from templates/email/css/*.css (however, it has hardcoded list of allowed files) and inject them into emails as inline styles. I believe it should be enough to change the line number 146 in templates/email/css/all-clients.css, which currently looks like this: a { color: #3b73af; text-decoration: none; }.

Hi Todor,

I've encountered the same problem and I simply recreated the changes I did in the old templates into the new templates. It's actually quiet straigthforward. Especially if you use the information provided by Henning.

Best regards,

Peter

Well, I didn't try to use the all old templates, I just used the ones created by me.

And ofcourse I reproduced the changes from old main templates ( e.g. issuecreated.vm ) in the templates in new version.

But the last time I had a starting point from documentation about inserting custom fields in JIRA emails. Rigth now I'm not sure if this documentation is up to date with the version 6.1.6.

Hi,

additional information about changes made in email templates in JIRA 6.1 can be found at https://developer.atlassian.com/display/JIRADEV/JIRA+email+template+changes. This containts a few examples how particular templates changed, along with further tips how to use new templates and macros. Hope this helps.

Cheers,

Maciej

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

491 views 6 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you