Changes between Version 3 and Version 4 of TracTicketsCustomFields


Ignore:
Timestamp:
Jun 9, 2024, 1:47:47 PM (6 weeks ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracTicketsCustomFields

    v3 v4  
    11= Custom Ticket Fields
    2 
    32Trac supports adding custom, user-defined fields to the ticket module. With custom fields you can add typed, site-specific properties to tickets.
    43
     
    1716
    1817=== Field Names
    19 
    2018A field name can only contain lowercase letters a-z, uppercase letters A-Z or digits 0-9, and must not start with a leading digit.
    2119
     
    6462     * `reference` to treat the content as a queryable value
    6563     * `list` to interpret the content as a list of queryable values, separated by whitespace
     64   * ticketlink_query: Query for linkifying ticket values.
     65     Not applicable for format `plain` and `wiki`.
    6666 * '''checkbox''': A boolean value check box.
    6767   * label: Descriptive label.
    6868   * value: Default value, 0 or 1.
    6969   * order: Sort order placement.
     70   * ticketlink_query: Query for linkifying ticket values.
    7071 * '''select''': Drop-down select box. Uses a list of values.
    7172   * label: Descriptive label.
     
    7374   * value: Default value (one of the values from options).
    7475   * order: Sort order placement.
     76   * ticketlink_query: Query for linkifying ticket values.
    7577 * '''radio''': Radio buttons. Essentially the same as '''select'''.
    7678   * label: Descriptive label.
     
    7880   * value: Default value, one of the values from options.
    7981   * order: Sort order placement.
     82   * ticketlink_query: Query for linkifying ticket values.
    8083 * '''textarea''': Multi-line text area.
    8184   * label: Descriptive label.
     
    97100
    98101Macros will be expanded when rendering `textarea` fields with format `wiki`, but not when rendering `text` fields with format `wiki`.
     102
     103For applicable fields, the `ticketlink_query` option
     104overrides [[TracIni#query-ticketlink_query-option|"[query] ticketlink_query"]], and the format is the same as
     105that option. When the `ticketlink_query` option
     106is not specified, `[query]` `ticketlink_query` is used to
     107linkify the field.
    99108
    100109=== Sample Configuration
     
    156165SELECT p.value AS __color__,
    157166   id AS ticket, summary, owner, c.value AS progress
    158 FROM ticket t, enum p, ticket_custom c
    159 WHERE status IN ('assigned') AND t.id = c.ticket AND c.name = 'progress'
    160   AND p.name = t.priority AND p.type = 'priority'
    161 ORDER BY p.value
     167  FROM ticket t, enum p, ticket_custom c
     168  WHERE status IN ('assigned') AND t.id = c.ticket AND c.name = 'progress'
     169AND p.name = t.priority AND p.type = 'priority'
     170  ORDER BY p.value
    162171}}}
    163172'''Note''': This will only show tickets that have progress set in them. This is '''not the same as showing all tickets'''. If you created this custom ticket field ''after'' you have already created some tickets, they will not have that field defined, and thus they will never show up on this ticket query. If you go back and modify those tickets, the field will be defined, and they will appear in the query.
     
    172181   reporter AS _reporter,
    173182   (CASE WHEN c.value = '0' THEN 'None' ELSE c.value END) AS progress
    174 FROM ticket t
    175    LEFT OUTER JOIN ticket_custom c ON (t.id = c.ticket AND c.name = 'progress')
    176    JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    177 WHERE status IN ('new', 'assigned', 'reopened')
    178 ORDER BY p.value, milestone, severity, time
     183  FROM ticket t
     184     LEFT OUTER JOIN ticket_custom c ON (t.id = c.ticket AND c.name = 'progress')
     185     JOIN enum p ON p.name = t.priority AND p.type='priority'
     186  WHERE status IN ('new', 'assigned', 'reopened')
     187  ORDER BY p.value, milestone, severity, time
    179188}}}
    180189