Remove the None option from a select list custom field in Jira server
The content on this page is a customisation. It is not supported by Atlassian Support. Please comment below with additional tips!
Platform Notice: Data Center Only - This article only applies to Atlassian products on the data center platform.
There are some instances where the 'NONE' in every select list needs to be removed. This can be achieved by making the field required or optional. Once the field is set to "Required", please make sure to take the 'NONE' value out of the Custom Field configuration (both as an actual option if present and as the default value for the field) or the 'NONE' value will still be an option.
If this is not an option, it is possible to customize JIRA applications to allow this behavior. This can be achieved by following this guide. This workaround will apply to all Select List Custom fields in the instance (the
edit-select.vm template is used by all Select List Custom Fields).
This guide is not kept up-to-date and velocity templates will change from version-to-version. The information provided is a guide only and may no longer be relevant in certain versions of JIRA applications.
To remove the field, edit
atlassian-jira/WEB-INF/classes/templates/plugins/fields/edit/edit-select.vm. Delete the 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 ...
The following code should remain:
... <select name="$customField.id" id="$customField.id"> #foreach ($option in $configs.options) <option value="$textutils.htmlEncode($option.value)" #if ($value && $value == $option.value)selected#end >$option.value</option> #end </select> ...
Make sure to back up the velocity file before changing it. Keep in mind the notes from Modifying JIRA Templates and JSPs.