I have a custom field of the type Select List . I wan to add the value of this field in the email notifications that are sent to the user.
Please let me know how can I do this. I have already had this implemented for JIRA 4.3.4. Is it the same for JIRA 5.0 also.
Amit.
Almost! If you are using the getCustomFieldValue, it retruns Option object in JIRA5. You need to do a getValue or toString on it.
Did you test it?
Thanks Jobin for the quick response. I did try this out. I made the changes to the atlassian-jira\WEB-INF\classes\templates\email\text\issuecreated. This is the change:
#if ($issue.getCustomFieldValue("customfield_10703"))
$stringUtils.leftPad($issue.getCustomField("customfield_10703").name, $padSize):$issue.getCustomFieldValue("customfield_10703").getValue()
$stringUtils.leftPad($issue.getCustomField("customfield_10703").name, $padSize):$issue.getCustomFieldValue("customfield_10703").toString()
#end
where customfield_10703 is the custom field created by me of type single select selectlist.
The same changes were made to the issuesummary.vm file located within includes folder at the above location.
Please let me know if this is correct.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
is it a select list or Version picker?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jobin,
Yes I have tested what u advices, but it is not working. I did tried both, getValue and toString. but it did not brought the Version value in the email notification.
Please help me out here.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is not a select list as you mentioned in the question! I don't think the version manager is available in templates and so you might not get the version name. toString should get you the version id, right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh!! my bad... Actually .toString does not give anything in the email. Is there any way I can get the Version value in the email notification. I do have this implemented this for JIRA 4.3.4 this way:
$stringUtils.leftPad($issue.getCustomField("customfield_10703").name, $padSize):$issue.getCustomFieldValue("customfield_10703")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are these the only files that need to modified: issuecreated.vm and issuesummary.vm. I could see that the email that I received follows a different template (I mean that the ordering of the fields is different).
Amit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What event are you trying to get emails for? Do you have html or text format? It is still possible in JIRA but I am not sure what is different for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JIRA 5.0
JIRA 4.3.4
Jobin,
The event that I am using is "issuecreated". The format is text. I have made changes to issuecreated.vm and includes\issuesummary.vm. If you been able to get this working at your end, then probably I might be doing something wroong. I have got this configured in exactly the same manner as in JIRA 4.3.4. In the above screenshot, the first one is JIRA 5.0 (does not include any version info). The second screenshot is JIRA 4.3.4 includes version information.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am unable to configure the default value for custom field of type selectlist in jira 4.4.5. I tested this in 4.1.2 it is working fine. Also the default value it is showing me is null. I have attached the code below . The execute method is throwing the following error
2012-11-27 13:56:00,011 QuartzWorker-0 INFO ServiceRunner [plugins.calculate
dfields.scheduler.CalculatedFieldsJob] >> Appfire Custom Field Ext Plugin: Defau
lt value is not configured for custom field:Days In Progress
2012-11-27 13:56:00,011 QuartzWorker-0 ERROR ServiceRunner [org.quartz.core.
JobRunShell] Job DEFAULT.CalculatedFieldsJob threw an unhandled Exception:
java.lang.NullPointerException
at com.appfire.jira.plugins.calculatedfields.scheduler.CalculatedFieldsJ
ob.execute(CalculatedFieldsJob.java:153)
at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
at com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRun
nable.run(MultiTenantThreadPool.java:72)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:520)
2012-11-27 13:56:00,011 QuartzWorker-0 ERROR ServiceRunner [org.quartz.core.
ErrorLogger] Job (DEFAULT.CalculatedFieldsJob threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exc
eption: java.lang.NullPointerException]
at org.quartz.core.JobRunShell.run(JobRunShell.java:206)
at com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRun
nable.run(MultiTenantThreadPool.java:72)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:520)
* Nested Exception (Underlying Cause) ---------------
java.lang.NullPointerException
at com.appfire.jira.plugins.calculatedfields.scheduler.CalculatedFieldsJ
ob.execute(CalculatedFieldsJob.java:153)
at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
at com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRun
nable.run(MultiTenantThreadPool.java:72)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:520)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
I have customized the Email body message to include the custom fields in the email body.
I have done in Jira 4.4.5
Please check that the custom field IDs are correct.
I have modified 2 files ;
i. /<jira-installation-folder>/atlassian-jira-4.4.5-standalone/atlassian-jira/WEB-INF/classes/templates/email/text/issuecreated.vm
ii. / <jira-installation-folder>/atlassian-jira-4.4.5-standalone/atlassian-jira/WEB-INF/classes/templates/email/text/includes/issuesummary.vm
Added the below lines of code in the issuecreated.vm and issuesummary.vm files :
#if ($issue.getCustomFieldValue("customfield_10006"))
$stringUtils.leftPad($issue.getCustomField("customfield_10006").name, $padSize): $issue.getCustomFieldValue("customfield_10006")
#end
This is working for me. Hope it helps you. :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much guys. I have got this resolved. The email notification is showing me the version value.
Thank you for all your effort.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just one more thing. Would you guys know how to do the same thing in the html format. How can I bring the value of the custom field in the html format.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it also possible to add the Issue Created date to the custom notifications?
Regards,
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anyone know which file one has to edit to customise the email when sharing an issue with somebody? I can't figure out what event that corresponds to or where else that might be configured
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.