Removing the 'none' option from a select field
If you are a JIRA plugin developer, you must have come across this feature request before. Some people just don't like the 'none' option in the select fields for various reasons. One reason, obviously, is to force the users to select a valid value.
How to do it...
Select Field
is a system custom field that uses velocity templates to render the view and edit screens. In order to remove the none
option, we need to modify the edit template.
For any system custom field, you can find the associated classes and their velocity templates from the file system-customfieldtypes-plugin.xml
residing under the WEB-INF/classes
folder.
In our case, we can find the following snippet related to select-field
:
<customfield-type key="select" name="Select List" i18n-name-key="admin.customfield.type.select.name" class="com.atlassian.jira.issue.customfields.impl.SelectCFType"> <description key="admin.customfield.type.select.desc">A single...