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...

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 ...

Get JIRA Development Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.