How to Change the Size of Text Area Custom 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 on this page relates to customizations in JIRA Applications. Consequently, Atlassian Support cannot guarantee the provision of 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.
Customisations to Velocity templates or other JIRA files are not included in the scope of Atlassian Support.
Deploying Velocity Templates without a Restart
In a development instance, you can play with picking up velocity file changes without a restart.
From <jira-install>/atlassian-jira/WEB-INF/classes/velocity.properties
:
Change class.resource.loader.cache from true to false
Uncomment (remove the # sign) from
1
#velocimacro.library.autoreload=true
to
1
velocimacro.library.autoreload=true
Keep in mind that the next time you upgrade JIRA – or need a new installation for any reason – you will have to manually copy any changes you have made to the JSPs or tempates into the new installation of JIRA. If the JSPs or templates have changed in the newer version, you will have to port your customization into them.
To work around the fixed size of a comment field, edit <jira-install>/atlassian-jira/WEB-INF/classes/templates/plugins/fields/edit/edit-textarea.vm
.
Solution
To change the size for all rows
1
$!rendererParams.put("rows", "2")
To change the size for a particular custom field
ℹ️In this example, the custom field's id is 10220. You can get this value from editing the custom field and checking the URL.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#controlHeader ($action $customField.id $customField.name $fieldLayoutItem.required $displayParameters.noHeader)
#if ($!customField.id=="customfield_10220")
## setup some additional parameters
$!rendererParams.put("rows", "2")
$!rendererParams.put("cols", "40")
$!rendererParams.put("wrap", "virtual")
## let the renderer display the edit component
$rendererDescriptor.getEditVM($!value,
$!issue.key, $!fieldLayoutItem.rendererType, $!customField.id,
$!customField.name, $rendererParams, false)
#elseif ($!customField.isRenderable() && $rendererDescriptor)
## setup some additional parameters
$!rendererParams.put("rows", "2")
$!rendererParams.put("cols", "40")
$!rendererParams.put("wrap", "virtual")
## let the renderer display the edit component
$rendererDescriptor.getEditVM($!value,
$!issue.key, $!fieldLayoutItem.rendererType, $!customField.id,
$!customField.name, $rendererParams, false)
#else
<textarea name="$customField.id"
id="$customField.id"
class="textfield"
rows="4" cols="40" wrap="virtual"
>$textutils.htmlEncode($!value)</textarea>
#end
#controlFooter ($action $fieldLayoutItem.fieldDescription $displayParameters.noHeader)
There is a feature request to allow this customization from within JIRA at JRA-20248.
Was this helpful?