Edgewall Software

Ticket #918 (new enhancement)

Opened 4 years ago

Last modified 13 days ago

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

Reported by: cboos@… Owned by: ecarter
Priority: high Milestone: 0.13
Component: ticket system Version: devel
Severity: normal Keywords: ticket custom multi tracobject multiple_select multiple select
Cc: jevans591@…

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@… 4 years ago.
patch that does the proposed feature

Change History

Changed 4 years ago by cboos@…

patch that does the proposed feature

  Changed 4 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).

  Changed 4 years ago by vittorio

  • severity changed from normal to enhancement

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

  • cc gunnar@… added

  Changed 2 years ago by anonymous

  • cc gunnar@… removed

  Changed 2 years ago by athomas

  • owner changed from cboos to athomas
  • status changed from assigned to new

  Changed 22 months ago by cboos

  • milestone set to 1.0

  Changed 22 months ago by cboos

  • keywords tracobject added
  • severity changed from enhancement to normal

  Changed 15 months ago by squiles

This enhancment will be very usefull.

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

  Changed 15 months ago by athomas

  • owner changed from athomas to ecarter

  Changed 7 months 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.

in reply to: ↑ description   Changed 7 months ago by cboos

  • priority changed from normal to high
  • milestone changed from 1.0 to 0.12

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.

  Changed 13 days ago by jevans <jevans591@…>

  • cc jevans591@… added

Add/Change #918 ([patch] Custom Ticket Fields should support the multiple selection type)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from ecarter. Next status will be 'new'
The owner will change from ecarter to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.