Change select option "NONE" to EMPTY value?

Christian Czaia _Decadis AG_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2012

Hey,

I have just edited the edit-select.vm as indicated here https://confluence.atlassian.com/display/JIRA/How+to+Remove+%27NONE%27+from+a+Select+List+Custom+Field

I deleted those lines:

#if (!$fieldLayoutItem || $fieldLayoutItem.required == false
    <option value="-1">$i18n.getText("common.words.none")</option>
  #else
    <option value="">$i18n.getText("common.words.none")</option>
  #end

I basically wanted to remove the NONE-option from a select field. I was hoping with no value set as default the field would be EMPTY on issue creation instead of being populated with the first value in the option list. This way I wanted to force people to select a value (field is marked as required).

What would happen if I just deleted the $i18n.getText("common.words.none") part or replaced "common.words.none" wit ""?

Thank you,

Christian

2 answers

1 accepted

0 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2012

You will have to remove the entire $i18n.getText("common.words.none") in the template. Javascript option will not work with inline edit in 5.1.

Christian Czaia _Decadis AG_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2012

Will Javascript work at all in description fields in 5.1?

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2012

Not with inline edit.

Christian Czaia _Decadis AG_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2012

thank you .

0 votes
Christian Czaia _Decadis AG_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2012

I'm goimg with a JS snippet found here as a comment:

https://confluence.atlassian.com/display/JIRA/How+to+Remove+%27NONE%27+from+a+Select+List+Custom+Field

<script type="text/javascript">try
{var select = document.getElementById('customfield_10071');select.options[0].text="";}

catch(err){}</script>

Suggest an answer

Log in or Sign up to answer