hello there
is there a way to send a default message when issues are created.
i have created a custom field but i don't see a field where i can add my default message.
kindly assist if know how one can add default message.
hi.
please read
https://answers.atlassian.com/questions/82337/jira-e-mail-template-customfield-options
in case you don't want to read through all that stuff:
create a new vm file in your
<JIRA_INSTALL>a/tlassian-jira/WEB-INF/classes/templates/email/html/includes/fields
(by default that should be in /opt/atlassian/jira/)
create a template (keep in mind that jira offers html and text email. so a template for each should be built)
name it something like your customfield for example.
i will show you an example template:
#disable_html_escaping() #if ($issue.getCustomFieldValue("customfield_<ID>")) <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("<NAME>"):</strong> </td> <td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;"> $issue.getCustomFieldValue("customfield_<ID>") </td> #end
to find out the ID of your customfield just navigate to Administration>Issues>Fields and highlight "Edit" on your customfield.
your browser status bar should show you something like i.e. :
https://your_jira_host/secure/admin/EditCustomField!default.jspa?id=11606
in that case 11606 is the ID of the customfield so add it to your code:
replace customfield_<ID> with customfield_11606 (note there are 2 occurances)
the <NAME> should be clear. add the customfields name here.
next step is to cd to:
<JIRA_INSTALL>/atlassian-jira/WEB-INF/classes/templates/email/html
you will find the issuecreated.vm here. open it with your preferred text editor (vi,vim,nano whatever)
at the bottom you will find:
<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/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/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>
simply add your previously created new vm file in between there and save the file.
now the easier part. for text emails go to:
<JIRA_INSTALL>atlassian-jira/WEB-INF/classes/templates/email/text
and edit the issuecreated.vm there. (looks different)
add this line (lets assume your customfield id is still 11606):
#if ($issue.getCustomFieldValue("customfield_11606")) $stringUtils.leftPad($issue.getCustomField("customfield_11606").name, $padSize): $issue.getCustomFieldValue("customfield_11606") #end
Now restart Jira and enjoy
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.