Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove None option from single select custom field?

Bunty
Contributor
December 6, 2018

Hello All,

Tried to remove None option from the single select custom field by checking the below URL. However, None option still appears in the Custom fields.

Jira Version - 7.12.3

https://confluence.atlassian.com/jirakb/how-to-remove-none-from-a-select-list-custom-field-144212308.html

Lines in the edit-select.vm

#disable_html_escaping()
#customControlHeader ($action $customField.id $customField.name $fieldLayoutItem.required $displayParameters $auiparams)
<select class="select cf-select" name="$customField.id" id="$customField.id">
#if (!$fieldLayoutItem || $fieldLayoutItem.required == false)
<option value="-1">$i18n.getText("common.words.none")</option>
#else
#if ( !$configs.default )
<option value="">$i18n.getText("common.words.none")</option>
#end
#end
#foreach ($option in $configs.options)
#if(!$option.disabled || $option.disabled == false || ($value && $value == $option.optionId.toString()))
<option#if ($value && $value == $option.optionId.toString()) selected="selected"#end value="$option.optionId">$cfValueEncoder.encodeForHtml($option.value)</option>
#end
#end
</select>
#customControlFooter ($action $customField.id $fieldLayoutItem.fieldDescription $displayParameters $auiparams)

Replaced it with the below lines:

<select class="select cf-select" name="$customField.id" id="$customField.id">
#end
#foreach ($option in $configs.options)
#if(!$option.disabled || $option.disabled == false || ($value && $value == $option.optionId.toString()))
<option#if ($value && $value == $option.optionId.toString()) selected="selected"#end value="$option.optionId">$cfValueEncoder.encodeForHtml($option.value)</option>
#end
</select>

Any help would be greatly upreciated.

Thanks,

Manikanta.

 

 

2 answers

0 votes
Bunty
Contributor
December 6, 2018

Hi @Joe Pitt,

I made the field required it still shows None option in the custom field.

Joe Pitt
Community Champion
December 6, 2018

That should fix it. Have you tried re-indexing? 

Bunty
Contributor
December 6, 2018

It is working for multi select custom fields but not single select list custom fields.

Bunty
Contributor
December 7, 2018

@Joe Pitt,

Any idea??

0 votes
Joe Pitt
Community Champion
December 6, 2018

Is there a particular reason you don't want to make it required? If you remove the none option what is the user supposed to select? None is there so the user doesn't have to select an option, hence their selection is None. 

Suggest an answer

Log in or Sign up to answer