- JIRA 6.x Administration Cookbook
- Patrick Li
- 274字
- 2021-12-08 12:37:36
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> #else #if ( !$configs.default ) <option value="">$i18n.getText("common.words.none")</option> #end #end
Make sure you do not change any other lines, then save the file, and restart JIRA.
Tip
You can remove the None option from other custom field types, such as multi-select by editing the appropriate file, for example, edit-multiselect.vm
.
How it works…
The Velocity .vm
template files are what JIRA uses to render the HTML for the custom fields. The code snippet we removed is what displays the None option. Note that by changing the template, we are removing the None option for all single select custom fields in JIRA. If you just want to remove the None option for a single custom field, refer to the Using JavaScript with custom fields recipe.
- 一本書學內部審計:新手內部審計從入門到精通
- 自愿審計動機與質量研究:基于我國中期財務報告審計的經驗證據
- 金融科技(FinTech)發展的國際經驗和中國政策取向(中國金融四十人論壇書系)
- 基于價值增值的治理導向型內部審計研究
- Mastering System Center Configuration Manager
- Business Intelligence with MicroStrategy Cookbook
- Microsoft System Center Data Protection Manager 2012 SP1
- Salesforce Essentials for Administrators
- Getting Started with Citrix VDI-in-a-Box
- 2016年度注冊會計師全國統一考試專用輔導教材(圖解版):審計
- 振蕩指標MACD:波段操作精解(升級版)
- 新編統計學
- Big Data Analytics with R and Hadoop
- Business Intelligence Cookbook:A Project Lifecycle Approach Using Oracle Technology
- Oracle E-Business Suite Financials R12:A Functionality Guide