Setting a Default Value in the Description Field

Usage FAQ

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

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:

  1. Locate and backup the file: WEB-INF/classes/templates/jira/issue/field/description-edit.vm
  2. Open that file:
    
    #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'))
    
  3. Add a section like this:
    
    #if($description == '')
    #set ($description = 'Put stuff here:')
    #end
    
    So, ultimately it should look something like:
    
    #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'))
    
  4. Restart your JIRA instance.

Adding multi-line values

If you wish to display in the description a default value of:


Step 1

Step 2

Step 3

you'll need to tweak the above instructions a bit:


#set ($description = "Step 1\
\
Step 2\
\
Step 3")
#set ($description = $description.replace('\',' '))

Unknown macro: {htmlcomment}

Severity: Low
Regular Expression: default value.*[dD]escription field
Article ID: JIRAKB370705080

http://support.atlassian.com/browse/JSP-25785

Last modified on Aug 23, 2010

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.