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 wanting 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
in the WEB-INF/classes
folder.
In our case, we can find the following code 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 select list with...