Custom Field Width Less than Available Options Length

Still need help?

The Atlassian Community is here for you.

Ask the community

The content on this page is a customisation. It is not supported by Atlassian Support. Please comment below with additional tips!

Symptoms

After upgrade your JIRA instance to version 4.2 or higher, some custom fields become truncated when viewing the selected options.

Cause

This occurs because after version 4.2, the CSS responsible for displaying the options of custom fields provides only a fixed width value (of 250px) to custom fields. Custom fields that ship with JIRA are fixed for this change, but custom fields from third party plugins may experience the issue. This is fixed in  JRA-24112 - Getting issue details... STATUS  &  JRA-36062 - Getting issue details... STATUS .

Resolution

Upgrade to JIRA 6.1.6 or higher as this is fixed in that version.

Workaround 1 - Modifying the custom field template file

  1. On the filesystem, navigate to $JIRA_INSTALL/atlassian-jira/WEB-INF/classes/templates/plugins/field/edit/;
  2. Choose the custom field type you want to edit and backup the related file. (e.g. Single Select List: edit-select.vm);
  3. Find the select attribute line (e.g. <select class="select" name="$customField.id" id="$customField.id">) and add the parameter style="width:auto; max-width:100%" inside it. (e.g. <select class="select" name="$customField.id" id="$customField.id" style="width:auto;max-width=100%">);
  4. Save your modifications and restart JIRA. All of your custom fields of that type will then display with the customized CSS from step 3.

Workaround 2 - Using Javascript

  1. Go to Administrator > Custom Fields
  2.  Click on Custom field whose width or size you want to update
  3. Click Edit button next to it.
  4. Update the Description section as below

    <script type="text/javascript">
    
    var j = document.getElementsByName('customfield_14295');
    
    if(j.length > 0)
    
    j[0].setAttribute("style","width: auto");
    
    j[0].setAttribute("size", "8");
    
    </script>
Last modified on Feb 26, 2016

Was this helpful?

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