Excerpt | ||
---|---|---|
| ||
Sometimes 'None' is a misleading word in select lists. |
Say you have an field called Security Impact
, a select list with possible values Yes, No and Unsure. You want to force users to consciously pick an option, so you mark the field 'Required' in the field configuration. JIRA displays this as:
...
JIRA has added a fake 'None' option at the beginning, meaning "No value has yet been selected". 2025 Update: Modern Jiras remove the 'None' if a field is required and has a default value:
Jira | ||||||
---|---|---|---|---|---|---|
|
In most cases the word "None" makes sense (e.g. Priority: None)
, but not here: "None" is identical in meaning to our real option, "No".
How do we make "None" go away? There are 3 options I know of.
Add a fake whitespace option, and mark it the default
When a select list is marked required, and has a default value, then 'None' disappears (https://jira.atlassian.com/browse/JRASERVER-3666). So the idea here is to add a select-list option with value " ", and mark it the default.
This works, but breaks JIRA's enforcement of the field's required'ness. Users can create issues with the default value " " selected.
This problem can be avoided using ScriptRunner Behaviours, setting an error on the field if its value is " ". This works, but Behaviours is bypassed by the REST API and Automation for JIRA.
Hack JIRA's select list template to replace 'None' with ''
...
Don't be tempted to use a JIRA translation plugin to map common.words.none
to to '', as that will break many other uses where 'None' is the correct meaning.
Add a fake whitespace option, and mark it the default
This achieves our blank line, but in a different way:
When a select list is marked required, and has a default value, then 'None' disappears (https://jira.atlassian.com/browse/JRASERVER-3666). So the idea here is to add a select-list option with value " ", and mark it the default.
This works, but breaks JIRA's enforcement of the field's required'ness. Users can create issues with the default value " " selected.
This problem can be avoided using ScriptRunner Behaviours, setting an error on the field if its value is " ". This works, but Behaviours is bypassed by the REST API and Automation for JIRA.
Use radio buttons instead of a select list
...
- If you use JIRA Cloud, or don't want to maintain a JIRA hack, using radio buttons is the way to go (tip: ScriptRunner has a built-in script to migrate field types).
- If you don't mind maintaining a source hack, fixing the .vm file is the cleanest option.
- If you really have to, a fake blank option can work, as long as you don't mind the extra implementation work, and the limitation of the Behaviours plugin.
...