Edgewall Software
Modify

Ticket #918 (new enhancement)

Opened 7 years ago

Last modified 4 weeks ago

[patch] Custom Ticket Fields should support the multiple selection type

Reported by: cboos@… Owned by: ecarter
Priority: high Milestone: next-major-0.1X
Component: ticket system Version: devel
Severity: normal Keywords: ticket custom multi tracobject multiple_select multiple select
Cc: jevans591@…, itamarost@…
Release Notes:
API Changes:

Description

I propose an addition to the TracTicketsCustomFields.

Currently, there is support for the
simple selection field:

<field>.type = select

I would like to have the multi type as well, for multiple selection fields.

The usage in trac.ini for multi
would be the same as it is for select.

I implemented it in a crude way (see the accompanying patch).

I'm not entirely pleased with the patch:

  • the support for query is partial (i.e. it won't work)
  • the display of the fields is not as neat as I would like

A better solution would involve a change in the database:
drop the unicity constraint on the (id,name) pair for
the ticket_custom table.
With that, the query support would be easier to add.

Attachments

multi.1048.patch (5.5 KB) - added by cboos@… 7 years ago.
patch that does the proposed feature

Download all attachments as: .zip

Change History

Changed 7 years ago by cboos@…

patch that does the proposed feature

comment:1 Changed 7 years ago by cboos

  • Owner changed from jonas to cboos
  • Status changed from new to assigned

While the above patch and idea could be revived,
I actually plan to support multiple selection in another way,
in the context of the TracLightWeightObjectModel?
(in short: if a Wiki page is created from a Wiki template, it will have that template as a type associated to it, by the way of a is-a relationship)


Let's take the example of an Operating System field,
because that's pretty common.

There would have to be a OperatingSystemTemplate wiki page
template, and one would create as many wiki pages as one
has operating systems to deal with...

The custom field operating_system would be
defined as a relation field, of kind multi:

  • the possible values will come from a relation
  • the actually selected values will be stored in another relation
    [ticket-custom]
    operating_system = relation
    operating_system.label = Operating System(s)
    operating_system.kind = multiple
    operating_system.from = is-a OperatingSystemTemplate
    

For editing the field in ticket page, the multiple selection field
will be filled with the name of all the existing pages
which have been created with the OperatingSystemTemplate

The current values will be retrieved from the
has-operating-system relation (the source being
the current ticket).

comment:2 Changed 7 years ago by vittorio

  • Severity changed from normal to enhancement

comment:3 Changed 7 years ago by Gunnar Wagenknecht <gunnar@…>

  • Cc gunnar@… added

comment:6 Changed 6 years ago by anonymous

  • Cc gunnar@… removed

comment:7 Changed 5 years ago by athomas

  • Owner changed from cboos to athomas
  • Status changed from assigned to new

comment:8 Changed 5 years ago by cboos

  • Milestone set to 1.0

comment:9 Changed 5 years ago by cboos

  • Keywords tracobject added
  • Severity changed from enhancement to normal

comment:10 Changed 4 years ago by squiles

This enhancment will be very usefull.

The patch is very old, and cannot be applied to the 0.10.3 version

comment:11 Changed 4 years ago by athomas

  • Owner changed from athomas to ecarter

comment:12 Changed 4 years ago by Peter

  • Keywords multiple_select multiple select added

Having multiple-select ticket fields would be very useful - when developing web apps it would be great if people can "Select all browsers having this problem" from the list.

comment:13 in reply to: ↑ description Changed 4 years ago by cboos

  • Milestone changed from 1.0 to 0.12
  • Priority changed from normal to high

A better solution would involve a change in the database:
drop the unicity constraint on the (id,name) pair for
the ticket_custom table.
With that, the query support would be easier to add.

... or add an occurrence number:

	    Table('ticket_custom', key=('ticket', 'name', 'occ'))[
	        Column('ticket', type='int'),
	        Column('name'),
	        Column('value'),
	        Column('occ')]

For most fields, this would just be NULL, but for the multi type, there would be a different number for each value.

comment:14 Changed 3 years ago by jevans <jevans591@…>

  • Cc jevans591@… added

comment:15 follow-up: Changed 3 years ago by cboos

#8026 requested essentially the same thing, though suggesting a different user interface.
I agree that for implementing the UI for multiple selection, it would be nicer to use multiple checkboxes instead of a multiple select field.

comment:16 Changed 3 years ago by anonymous

  • Owner changed from ecarter to aaaa

comment:17 Changed 3 years ago by rblank

  • Owner changed from aaaa to ecarter

Please stop that.

comment:18 in reply to: ↑ 15 Changed 3 years ago by jevans

Replying to cboos:

#8026 requested essentially the same thing, though suggesting a different user interface.
I agree that for implementing the UI for multiple selection, it would be nicer to use multiple checkboxes instead of a multiple select field.

We tried multiple check boxes for affected platforms but found they grew out of control over time. We'd like to be able to have a scrollable multi-select list box. Summaries and reports could show a delimited list of the selected items.

comment:19 follow-up: Changed 2 years ago by dantudor

Is this ticket in progress by anyone?
A multi-option select box would be great functionality for a custom field.
I am happy to contribute to creating a patch that is applicable to the latest version of trac if anyone is available to document the necessary steps.

comment:20 in reply to: ↑ 19 Changed 2 years ago by rblank

Replying to dantudor:

Is this ticket in progress by anyone?

Not that I know of.

comment:21 Changed 20 months ago by cboos

See related discussion in #9466, real multivalued support would make the is query behave unambiguously, as opposed to a contains query on a single field containing multiple space or comma separated values.

comment:22 Changed 16 months ago by itamaro

  • Cc itamarost@… added
  • Milestone changed from next-major-0.1X to 0.12.2

comment:23 Changed 16 months ago by itamaro

  • Milestone changed from 0.12.2 to next-major-0.1X

didn't mean to change the milestone...

comment:24 Changed 4 months ago by julrich

As a hint: there also exists a patch on track-hacks.org that implements this: http://trac-hacks.org/wiki/MultiSelectCustomFieldsPatch

comment:25 Changed 4 weeks ago by shoffmann

There is no normalization of multiple-values input for ticket keywords. This has been raised as a complaint in th#9692 against th:TagsPlugin, because it causes trouble for the use of keywords as tags. So this should be about multiple values in general, where it makes sense, not only for custom fields.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from ecarter. Next status will be 'new'
The owner will be changed from ecarter to anonymous. Next status will be 'assigned'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.