Book Image

JIRA 6.x Administration Cookbook

By : Patrick Li
Book Image

JIRA 6.x Administration Cookbook

By: Patrick Li

Overview of this book

Table of Contents (16 chapters)
JIRA 6.x Administration Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Removing the none option


Custom field types such as select list (single and multi) come with the None option, and the only way to remove that is to make the field required. While this makes sense, it can be cumbersome to chase down every field and configuration.

In this recipe, we will remove the None option from all single select list custom fields.

Getting ready

Since we will be modifying physical files in JIRA, you will want to make backups of the files we change.

How to do it…

JIRA uses Velocity templates to render custom fields. These templates are mostly HTML with some special symbols. You can find all these files in the JIRA_INSTALL/atlassian-jira/WEB-INF/classes/plugins/fields directory, and the edit view templates are in the edit subdirectory.

So we need to open the edit-select.vm file in a text editor and remove the following code snippet:

#if (!$fieldLayoutItem || $fieldLayoutItem.required == false)
        <option value="-1">$i18n.getText("common.words.none")</option>
 ...