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")
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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; }.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.