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.
There are two ways to hide the none
option on the client side, using a JavaScript hack, or on the server side, by modifying the velocity templates that renders the select field. Let us see both, in different contexts.
First, we will see how to hide the none
option on a given custom field with the ID 10000
. All we have to do here is to add the following JavaScript snippet in the description of the field. As mentioned in the previous recipe, make sure the description is edited in the appropriate field configuration, if applicable:
<script type='text/javascript'> JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) { hideNone(); }); AJS.$(document...