New and Improved 3.13 Beta. Highlights: Shareable filters and dashboards and lots of other goodies. Any feedback can be raised as JIRA issues in the JIRA project.
Issue Details (XML | Word | Printable)

Key: JRA-4689
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Jeff Turner [Atlassian]
Votes: 5
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
JIRA

Boolean custom field type

Created: 28/Sep/04 10:43 PM   Updated: 21/Jan/08 01:18 PM
Component/s: Custom Fields
Affects Version/s: 3.0
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: None
Image Attachments:

1. checkbox_finished.png
(1 kB)

2. Sample_Checkbox.jpg
(3 kB)

Participants: Eric Rawlins and Jeff Turner [Atlassian]
Since last comment: 30 weeks, 1 day ago
Labels:


 Description  « Hide
It would be good to have a 'boolean' custom field type, represented as a single checkbox.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jeff Turner [Atlassian] added a comment - 21/Oct/04 11:55 PM
This would be particularly useful for emulating Bugzilla's 'keywords' feature (an arbitrary text field which can be used to store flags like 'patchAttached').

Eric Rawlins added a comment - 17/Jan/08 01:09 PM
I feel bad breaking a 3 years without a comment streak, but I find myself wanting this or similar functionality.

I have a screen with about 30 custom fields that essentially represent a checklist. I'm implementing this as multi-checkboxes, with a single option 'Completed'. What I really want is a single checkbox field that is checked or unchecked.


Jeff Turner [Atlassian] added a comment - 17/Jan/08 05:13 PM
Eric,

It's a bit of a hack, but you can could make a multi-checkbox with a single option whose label is " ". This will render as whitespace, leaving just the checkbox:

Would that do?


Eric Rawlins added a comment - 17/Jan/08 06:09 PM
That might work with limited effectiveness. As far as the edit UI is concerned it would appear like a normal checkbox.

It would be a little odd in the view UI though because the field would appear on the screen with no value. A real single value checkbox would probably display 'True' while viewing issues.

This workaround also wouldn't be very intuitive while searching for issues. For my specific needs it might actually be okay because none of my single-item multi-checkbox fields have searchers configured. I'm not sure I want to go with a solution that might have usability problems down the road, if I wanted to enable searching. I'll give it a try and see how it looks.

I'm surprised nobody has created this as a custom field plugin.


Jeff Turner [Atlassian] added a comment - 17/Jan/08 07:24 PM
Yes, it doesn't display anything intuitive on the "view issue" screen. Although its mere presence indicates the value is "true", since JIRA doesn't display anything for unset custom fields.

It does work for searching though. You get exactly the same checkbox displayed as on the "Create issue" screen:


Eric Rawlins added a comment - 17/Jan/08 10:26 PM
Jeff,

Interesting hack. I had not actually used a multi-checkbox searcher before so I wasn't picturing how it would look. You are correct, it is very intuitive. This is an excellent workaround and really doesn't hurt anything.

The only downside is that no value appears in the view screen. I agree with you that the simple presence of the item in the list is an indicator that the value has been selected. It would be nice to have a value there though. Since that is non critical maybe I'll see if there is a way to edit the view screen to replace a custom field value exactly equal to one space with 'True', for readability purposes.

For my purposes I'm really only using these checkboxes as JIRA-checklist during workflow transitions. I plan to use the 'Field Required' validator to ensure that all the items are checked before I let the transition continue. I am implementing a workflow for a process that a lot of people seem to need a reminder for what they should do. This workaround makes the checkbox far more intuitive, and since it is really only needed during transitions the lack of an actual value on the view screen is not critical.

Thanks,
Eric


Jeff Turner [Atlassian] added a comment - 18/Jan/08 02:54 AM
> The only downside is that no value appears in the view screen.

To extend the hack a bit, you could make the checkbox value a bit of Javascript that only displays when we're in a /browse/ URL (ie. viewing the issue):

<script>if (/\/browse\//.test(document.location)) { document.write("true"); }</script>

All this hackery does demonstrate that a simple boolean custom field type is still needed.


Eric Rawlins added a comment - 18/Jan/08 02:45 PM
Heh, this is such a hack. I love it

I tried this script approach and it works for me. Thanks a lot for the feedback Jeff, hopefully someone else will find this and get some use out of it as well. I'll leave my vote and watch up though, because it would be nice to have this implemented officially at some point in time but this workaround meets 100% of my immediate needs and, since this is a 3 year old ticket, is probably as good as it is going to get


Eric Rawlins added a comment - 21/Jan/08 01:16 PM - edited
This might be useful to someone who is trying to have a checklist. Using Jeff's workaround this shows a check icon on the issue view screen

<script> if (window.location.href.indexOf('/browse/') >= 0) document.write('<img src="/images/icons/emoticons/check.gif">'); </script>