How to hide "None" option single select custom field?

Bunty December 12, 2018

Hello Everone,

I've made a single select custom field required. however, it is still showing the "None" option in the custom field. I've also performed re-indexing but the "None" still exists in the custom filed.

And I also 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.

 

 

3 answers

0 votes
Cuno Reitzenstein
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 12, 2020

When you set a default Value for your customfield (in the "Configure Custom Field"-Menu) the "none" option will disapear...

Johannes Rudolf April 7, 2020

In case you set a default value for a (single|multi|cascading) select field make sure to restrict the given to field to dedicated projects and/or issue types where the field definitely will be used.

Otherwise Jira will assume that you *could* use this field anywhere else across your instance hence this value will be stored in your database upon issue creation no matter what the project/issue type is and whether or not this field will be appear on the associated screen or not. And in case you're going to add this field on another screen the value is available. That's the logic behind.

As a result however you may - at least for larger instances - face performance issues since the index will increase unnecessarily as well as continuously. For a customer we had quite a large work to fix this.

0 votes
Johannes Rudolf May 7, 2019

I came across this page since I have a similar problem (I cannot make the "None" option invisible/unavailable during a workflow transition even though the field is mandatory during the transition). It is pretty obvious that I have to make a field fully mandatory, not only during a transition. But I can populate this field only during the workflow, not at the beginning (create issue).

Furthermore, I was advised to use "Deviniti Dynamic Forms" to make the "None" option unavailable. However it only works with a side effect when it comes to another plugin used for the same transition (Extension for Service Desk). Most of the issues within a JSD project will be triggered by mail, hence users will have to set request type manually. As the users are not really experienced with Jira and may overlook to set the request type without being prompted during a transition, they should be able to set request type during the very first transition once the issue is created. Based on the selected request type other issues will be created automatically.

However, the side effect is that any selected request type will be set during transition but not be displayed on transition screen once chosen, which is quite confusing. Once I disable Dynamic Forms everything is fine. But preferably I can use both plugins for their respective purpose.

0 votes
Ismael Jimoh
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.
December 12, 2018

That is odd.

Can you check the options of the field to confirm that None is not an option.

Also check and ensure you made it required in the correct field configuration.

As for modifying the .vm file, I don’t know if a restart is required but I will say give it a shot.

Johannes Rudolf May 7, 2019

From my experience a restart is required. We had done this earlier to change the contents of email notifications (which are also *.vm files).

Suggest an answer

Log in or Sign up to answer