I have created several custom fields in Jira -
I have added these fields to outgoing HTML emails (issueassigned.vm) and I have also created the corresponding fields (assignedgroup.vm, customer.vm and plannedstart.vm)
When the email is sent out, the data in the email does not match the true data values.
For Example -
Assigned Group: [com.atlassian.crowd.embedded.impl.ImmutableGroup@14cd6]
(This should be Uno for the Group Name)
Customer: aarockia:10001
(This should be Arockiasamy, Anthony)
Planned Start: 2013-05-11 00:00:00.0
(This Should be 05/11/13 12:00 AM)
$issue.getCustomFieldValue("customfield_11000").get(0).name
works for the assigned group
I got the date to work as well with the following -
#disable_html_escaping()
#if ($issue.getCustomFieldValue("customfield_10308"))
<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("Planned Start"):</strong>
</td>
<td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;">
$dateformatter.formatDMYHMS($issue.getCustomFieldValue("customfield_10308"))
</td>
#end
</tr>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got the Custom user field to show properly in the email by using -
#disable_html_escaping()
#if ($issue.getCustomFieldValue("customfield_11400"))
<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("Customer"):</strong>
</td>
<td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;">
#authorlink($issue.getCustomFieldValue("customfield_11400").name)
</td>
#end
</tr>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try 'getDisplayName()'
Following worked for me, for multi-user custom fields. You can try the same for group picker too:
#if($issue.getCustomFieldValue("customfield_xxxxx"))#foreach($c_p in $issue.getCustomFieldValue("customfield_xxxxx"))$c_p.getDisplayName()#if($velocityCount != $issue.getCustomFieldValue("customfield_xxxxx").size()), #end#end#{else}Not Specified#end
(replace 'customfield_xxxxx' with the actual text ID of the required custom field in your instance)
For date picker you can use the dateformatter,
#if($issue.getCustomFieldValue("customfield_xxxxx"))$dateformatter.formatDateTimePicker($issue.getCustomFieldValue("customfield_xxxxx"))#{else}Not specified#end
Refer to Atlassian's developer documentation and javadocs for more information. (Google them)
Also, following question might be helpful:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried this setup -
#disable_html_escaping()
#if($issue.getCustomFieldValue("customfield_10308"))$dateformatter.formatDateTimePicker($issue.getCustomFieldValue("customfield_10308"))#{else}Not specified#end
and it does not work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I hope you already know how to make VM teplate changes effective without restarting JIRA.
Then, do the following,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
All I am missing is the Group Picker.... Any idea how this is formated?
Using the following type of format I got the user picker and the date to work properly... now I'm just missing the Group Picker custom field
#authorlink($issue.getCustomFieldValue("customfield_10094").name)
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.
I tried this setup -
#disable_html_escaping()
#if ($issue.getCustomFieldValue("customfield_11207"))
<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("Assigned Group"):</strong>
</td>
<td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;">
$issue.getCustomFieldValue("customfield_11207").getValue();
</td>
#end
</tr>
And it does not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is a sample of the assignedgroup.vm file -
#disable_html_escaping()
#if ($issue.getCustomFieldValue("customfield_11207"))
<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("Assigned Group"):</strong>
</td>
<td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;">
$issue.getCustomFieldValue("customfield_11207")
</td>
#end
</tr>
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.