Hi All,
I have a big trouble with the HTML email template.
One of a project of our Jira instance need a custom create issue email template. They need only a few fields displayed, no hyperlinks and a custom field.
We inherited the Jira from a previous team but we aren't acquinted with HTML editing.
I attach the current email template and the HTML code - the top left part.
I signed the necessary fields and wishes on the attached pic.
Whenever we change something in the email template we get error message in the email.
All you need to do is to remove the unwanted fields - starting from #text to the next #text. For the key, you can replace #text("common.concepts.key") with Request Number
Hi Jobin,
it didn't work! I changed the #text("common.concepts.key") with Request Number and I got an error email. See attached txt!
Maybe is it in connection with the issuecreated.vm file? Because it contains only a few lines parsing these header, summary,etc. templates:
#parse("templates/email/html/includes/header.vm") #parse("templates/email/html/includes/summary-topleft.vm") #parse("templates/email/html/includes/summary-bottom.vm") #parse("templates/email/html/includes/footer.vm")
I am so disapponted because I have no idea why I got error mails.
Thanks for help!
Rumi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It complains about an extra #end. Is it working without that single change?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, the problem is, there is an extra #end at line 474 ;) Can you attach the trmplate as a .txt file?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes it's working without the change.
IT is HTML email template I didn't mention.
What can be wrong?
Jobin,
have you got a private email. I would send you the summary-top-left.vm and the issuecreated.vm for you. The original summary-top-left.vm is what I pasted above.
Thanks in advance for your help!
RUmi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
(summary_topleft.txt) (error_email.txt) (issuecreated.txt)
Hi Jobin,
I attach the 3 .txt files: the text of the last error email after I changed #text("common.concepts.key") with Request Number. Then I attach the Summary-topleft text and the issuecreated.vm
If you need additional files, let me know and I attach them too.
How can be a code error message like this:
An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.ParseErrorException: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 440, column 84. Encountered: "q" (113), after : "&" at org.apache.velocity.Template.process(Template.java:141) at
when I only changed #text("common.concepts.key") to 'Request Number'????
PS.: I made the changes in Word.
Thank you for your help!
Rumi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oops..is that your vm file? Or did you take the html source from somewhere? !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jobin,
yes they are.
Let me know if something wrong with them or you need additional info!
I would send you in Word but the forum doesn't let.
In the meantime I realized that I shouldn't edit the .vm files in Word but in Notepad.
Thanks in advance!
Rumi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is one big file and I don't have time to debug it to be frank! Too big to know where the problem is without spending time. I suggest you do 2 things. First, remove everything except the issue key and make it working with the original #text tag. And then try replacing it as I suggested.
If that doesn't work, attach both the working version and the modified version. It will be easier to debug in that case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I sent you an incorrect part.
Weel the problem was that I edited the .vm file in Word. Now I edited in Notepad and I got the needed Request Number field!
My question is how can I remove the hyperlinks from the script?
<table cellpadding="3" cellspacing="0" style="border-top-style:none;border-right-style:none;border-bottom-style:solid;border-left-style:none;border-width:1px;border-color:#3c78b5;" width="100%"> <tr> <td style="background-color:#ddd;"> <b>#text("common.concepts.issue")</b> (<b><a href="${baseurl}/browse/${issue.getKey()}">#text("template.view.online")</a></b>)<br/> </td> </tr>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome! Remove a href and the matching closing tag. i.e.
<a href="${baseurl}/browse/${issue.getKey()}">
and
</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh yeah, go ahead and remove it ;) Try just
$issue.assigneeUser.name
Try $issue.assigneeUser.displayName or
$issue.assigneeUser.fullName depending on JIRA version if you want full name instead of user name.
Same for reporter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jobin,
thank you!
I also would like to remove the hyperlink from the Assignee and Reporter fields. How can I do that.
Here is the code but I don't dare to remove #authorlink. Can it be??
<tr style="vertical-align:top;"> <td style="font-weight:bold;white-space:nowrap;">#text("issue.field.assignee"):</td> <td> #if ($issue.assigneeUser) #authorlink ($issue.assigneeUser.name) #else #text("common.concepts.unassigned") #end </td> </tr> <tr style="vertical-align:top;"> <td style="font-weight:bold;white-space:nowrap;">#text("issue.field.reporter"):</td> <td> #if ($issue.reporterUser) #authorlink ($issue.reporterUser.name) #else #text("common.concepts.no.reporter") #end </td> </tr>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jobin,
thanks for the suggestion, it works great!
I'd like to ask you how to display the content of a custom field on an email template? How can I reference on the custom field?
Something like this??:
#if ($issue.getCUSTOMFIELDNAME()) <tr style="vertical-align:top;"> <td style="font-weight:bold;white-space:nowrap;">#text("issue.field.resolution"):</td> <td> $textutils.htmlEncode($issue.getCUSTOMFIELDNAME().getNameTranslation($i18n), false) </td> </tr> #end
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jobin,
thank you very much for your help so far!
I finally could create an email template we wanted.
There is only 3 problems left:
1. There is a frame which we cannot erase from the template (I marked it with an arrow in the attached pic)
2. We have a custom field called "Comment to reporter" which is a free text field. In the Jira we wrote the message in many lines but in the email it appears in one line which is not so pretty. How can we solve this?
3. The project leader needs a static field under the issue details: this is the "Lorem ipsum.." dummy text on the pic. It is in the footer.vm. The problem is that we need this static field from "wall-to-wall": I mean that from the left side of the email to the right side. Now this static field grew down.
Can you please suggest and help?
Thanks in advance!
Rumi
Ps: can you see the attached pic?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.