|
[
Permlink
| « Hide
]
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').
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. 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? 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. 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:
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, > 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. 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 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>
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||