Notification schemes

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.

1 answer

This widget could not be displayed.

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_&lt;ID&gt;"))
&lt;tr valign="top"&gt;
    &lt;td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 10px 10px 0;white-space:nowrap;"&gt;
        &lt;strong style="font-weight:normal;color:${textSubtleColour};"&gt;#text("&lt;NAME&gt;"):&lt;/strong&gt;
    &lt;/td&gt;
    &lt;td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;"&gt;
        $issue.getCustomFieldValue("customfield_&lt;ID&gt;")
    &lt;/td&gt;
#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:


&lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;
                        #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")
                    &lt;/table&gt;

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

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

141 views 16 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you