Setting a Default Value in the Description Field
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
The information in this page relates to customizations in Jira. Consequently, Atlassian Support cannot guarantee to provide any support for the steps described on this page as customizations are not covered under Atlassian Support Offerings. Please be aware that this material is provided for your information only and that you use it at your own risk.
Also, please be aware that customizations done by directly modifying files are not included in the upgrade process. These modifications will need to be reapplied manually on the upgraded instance.
This page describes how to set a Default Value for the Description field in JIRA. There's a feature request for this at JRA-4812. Please watch and vote on the issue if this is important to you.
There are workarounds to add this functionality. The modification does not persist if you upgrade JIRA so you'll have to re-apply these steps again in the future. Here are directions to set a default value for your Description field in JIRA:
Locate and backup the file:
WEB-INF/classes/templates/jira/issue/field/description-edit.vm
Open that file:
1 2 3 4 5 6 7 8 9 10
#controlHeader ($action $field.id $i18n.getText($field.nameKey) $fieldLayoutItem.required $displayParameters.get('noHeader')) ## setup some additional parameters $!rendererParams.put("rows", "12") $!rendererParams.put("wrap", "virtual") ## let the renderer display the edit component $rendererDescriptor.getEditVM($!description, $!issue.key, $!fieldLayoutItem.rendererType, $!field.id, $!field.name, $rendererParams, false) #controlFooter ($action $fieldLayoutItem.getFieldDescription() $displayParameters.get('noHeader'))
Add a section like this:
1 2 3
#if($description == '') #set ($description = 'Put stuff here:') #end
So, ultimately it should look something like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#controlHeader ($action $field.id $i18n.getText($field.nameKey) $fieldLayoutItem.required $displayParameters.get('noHeader')) ## setup some additional parameters $!rendererParams.put("rows", "12") $!rendererParams.put("wrap", "virtual") #if($description == '') #set ($description = 'Put stuff here:') #end ## let the renderer display the edit component $rendererDescriptor.getEditVM($!description, $!issue.key, $!fieldLayoutItem.rendererType, $!field.id, $!field.name, $rendererParams, false) #controlFooter ($action $fieldLayoutItem.getFieldDescription() $displayParameters.get('noHeader'))
Restart your JIRA instance.
Solution
Adding multi-line values
If you wish to display in the description a default value of:
1
2
3
4
5
Step 1
Step 2
Step 3
you'll need to tweak the above instructions a bit:
1
2
3
4
5
6
#set ($description = "Step 1\
\
Step 2\
\
Step 3")
#set ($description = $description.replace('\',' '))
Was this helpful?