Custom Ticket Fields

Trac supports adding custom, user-defined fields to the ticket module. Using custom fields, you can add typed, site-specific properties to tickets.

Configuration

Configuring custom ticket fields is done in the trac.ini file. All field definitions should be under a section named [ticket-custom].

The syntax of each field definition is:

 FIELD_NAME = TYPE
 (FIELD_NAME.OPTION = VALUE)
 ...

The example below should help to explain the syntax.

Available Field Types and Options

  • text: A simple (one line) text field.
    • label: Descriptive label.
    • value: Default value.
    • order: Sort order placement. (Determines relative placement in forms.)
  • checkbox: A boolean value check box.
    • label: Descriptive label.
    • value: Default value (0 or 1).
    • order: Sort order placement.
  • select: Drop-down select box. Uses a list of values.
    • label: Descriptive label.
    • options: List of values, separated by | (vertical pipe).
    • value: Default value (Item #, starting at 0).
    • order: Sort order placement.
  • radio: Radio buttons. Essentially the same as select.
    • label: Descriptive label.
    • options: List of values, separated by | (vertical pipe).
    • value: Default value (Item #, starting at 0).
    • order: Sort order placement.
  • textarea: Multi-line text area.
    • label: Descriptive label.
    • value: Default text.
    • cols: Width in columns.
    • rows: Height in lines.
    • order: Sort order placement.

Sample Config

[ticket-custom]

test_one = text
test_one.label = Just a text box

test_two = text
test_two.label = Another text-box
test_two.value = Just a default value

test_three = checkbox
test_three.label = Some checkbox
test_three.value = 1

test_four = select
test_four.label = My selectbox
test_four.options = one|two|third option|four
test_four.value = 2

test_five = radio
test_five.label = Radio buttons are fun
test_five.options = uno|dos|tres|cuatro|cinco
test_five.value = 1

test_six = textarea
test_six.label = This is a large textarea
test_six.value = Default text
test_six.cols = 60
test_six.rows = 30

Note: To make entering an option for a select type field optional, specify a leading | in the fieldname.options option.

Reports Involving Custom Fields

The SQL required for TracReports to include custom ticket fields is relatively hard to get right. You need a JOIN with the ticket_custom field for every custom field that should be involved.

The following example includes a custom ticket field named progress in the report:

SELECT p.value AS __color__,
   id AS ticket, summary, component, version, milestone, severity,
   (CASE status WHEN 'assigned' THEN owner||' *' ELSE owner END) AS owner,
   time AS created,
   changetime AS _changetime, description AS _description,
   reporter AS _reporter,
  (CASE WHEN c.value = '0' THEN 'None' ELSE c.value END) AS progress
  FROM ticket t
     LEFT OUTER JOIN ticket_custom c ON (t.id = c.tA professor is one who talks in someone else's sleep.
[http://www.jaman.com/people/BuyCialis/ buy cialis drugs]
[http://www.kaboodle.com/buyviagra2 buy generic viagra]
http://buycialis.gather.com/
http://www.kaboodle.com/buyviagra2
[http://buycialis.cc/en/item/levitra.html levitra online]
[http://community.icontact.com/users/buy-tramadol where can i order tramadol]
Sv6ngrt
http://us.cyworld.com/buylevitra1
http://buytramadol.gather.com/
[http://www.aboutus.org/HeadacheTreatment.net fioricet headache treatment]
[http://forum.teamplay.it/index.php?automodule=blog&blogid=45&compra-viagra-online-cialis# viagra cialis]
http://www.gomedia.us/forum/member.php?u=1621
http://studenti.dsi.unive.it/forum/index.php?showuser=1212
<netgod> Feanor: u have no idea of the depth of the stupidty of american law
http://forum.teamplay.it/index.php?automodule=blog&blogid=45&compra-viagra-online-cialis#
 [http://www.sharepointblogs.com/members/buycialis/default.aspx Cialis on line prescriptions]
[http://compraviagraitalia.com/it/item/viagra.html cialis come viagra]
[http://www.megadirectory.it/SHOPPING/Compra-Viagra-Italia-Acquista-Viagra-Originale-e-Generico-Online-Spedizione-Gratuita-l1511.html viagra generico italia]
[http://buycialis.cc/it/item/generic_propecia.html ordina propecia]
http://compraviagraitalia.com/it/item/generic_propecia.html
http://www.folkd.com/user/tramadolonline
http://buycialis.reciter.com/
http://forums.3ivx.com/index.php?showuser=16168
http://www.jayde.com/15220257-buycialis.html
xafWZyJ [http://forum.studenti.it/members/compraviagra1.html ordinazioni viagra]
[http://www.gomedia.us/forum/member.php?u=1621 buy fioricet prescription online] [http://www.kaboodle.com/buycheapcialis cialis pharmacy]
lwMUzW. [http://www.sharepointblogs.com/members/buytramadol/default.aspx tramadol medication]
 BOFH Excuse #124:

user to computer ration too low.
[http://community.tasteofhome.com/members/BuyCialis/default.aspx buy generic cialis]
[http://buycialisonline.tv/product.php?prod=viagra brand viagra]
http://microsoftontheissues.com/cs/members/Buy-Generic-Cialis-Online.aspx
http://www.folkd.com/user/buyviagra1
[http://www.folkd.com/user/buylevitra1 levitra free shipping]
[http://community.icontact.com/users/buy-tramadol pain tramadol]
ndk4s2Z
http://buylevitra.gather.com/
http://forums.plexapp.com/index.php?showuser=8414
[http://buycialisonline.tv/product.php?prod=butalbital fioricet usa]
[http://www.euronics.it/forum/user/profile/11590.page?Compra_Viagra viagra ordina adesso in italia]
http://www.sims99.com/forum/member.php?u=9417&fioricet
http://compracialis.it/it/item/viagra.html
Smartness runs in my family.  When I went to school I was so smart my
teacher was in my class for five years.
                -- George Burns
http://www.euronics.it/forum/user/profile/11590.page?Compra_Viagra
 [http://buycialis.reciter.com/ Cialis without prescriptions]
[http://www.euronics.it/forum/user/profile/11590.page?Compra_Viagra dove comprare cialis generico]
[http://www.aboutus.org/compraviagraitalia.com comprare viagra generico]
[http://compracialis.it/it/item/generic_propecia.html comprare propecia online]
http://forum.pcworld.it/member.php?u=33505&propecia
http://www.jayde.com/15219715-relievepain.html
http://www.dogomania.com/forum/showthread.php?p=279776
http://www.aboutus.org/HeadacheTreatment.net
http://www.jayde.com/15220257-buycialis.html
FzLfGK3 [http://www.euronics.it/forum/user/profile/13031.page?Viagra-Cialis come comprare viagra online]
[http://www.sims99.com/forum/member.php?u=9417&fioricet purchase brand fioricet] [http://www.aboutus.org/BuyCialis.cc Cialis order]
o22e38U [http://buycialisonline.tv/product.php?prod=ultram prices tramadol]
 "Even nowadays a man can't step up and kill a woman without feeling
just a bit unchivalrous ..."
                -- Robert Benchley
[http://buycialis.reciter.com/ Cialis buy online]
[http://www.1up.com/do/my1Up?publicUserId=6065791 viagra online]
http://buy-cialis.blog.friendster.com/
http://buycialis.cc/en/item/viagra.html
[http://www.sims99.com/forum/member.php?u=9418&buy-levitra levitra]
[http://www.maclife.com/user/buy_tramadol_0 hcl tramadol]
qKtXVc3
http://www.sims99.com/forum/member.php?u=9418&buy-levitra
http://community.pchemma.se/members/tramadol.aspx
[http://fioricetonline.gather.com/ fioricet net]
[http://compracialis.it/it/item/viagra.html viagra]
http://www.folkd.com/user/buyfioricetonline
http://www.netsonar.it/7221-compra-viagra-in-italia/view-details.html
Out of the mouths of babes does often come cereal.
[http://subscene.com/members/buy_2D00_cialis.aspx Buy Cialis -> Order Cheap Cialis Online! Free Prescription!]
[http://buycialisonline.tv/product.php?prod=viagra buy viagra]
http://www.kaboodle.com/buycheapcialis
http://microsoftontheissues.com/cs/members/BuyViagra.aspx
[http://members.ebay.com/ws/eBayISAPI.dll?ViewUserPage&userid=cialis-levitra levitra]
[http://forums.plexapp.com/index.php?showuser=8414 tramadol org]
THScVyI
http://www.kaboodle.com/buylevitra
http://www.kaneva.com/channel/tramadol.people
[http://showhype.com/profile/Buy_Fioricet/ buy brand fioricet]
[http://www.euronics.it/forum/user/profile/11590.page?Compra_Viagra acquista viagra farmacia online]
http://www.folkd.com/user/buyfioricetonline
http://lasuperdirectory.altervista.org/single.php?id=352