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

Reports Involving Custom Fields

Custom ticket fields are stored in the ticket_custom table, not in the ticket table. So to display the values from custom fields in a report, you will need a join on the 2 tables. Let's use an example with a custom ticket field called progress.

Note that this will only show tickets that have progress set in them, which 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. If that's all you want, you're set.

However, if you want to show all ticket entries (with progress defined and without), you need to use a JOIN for every custom field that is in the query.

Updating the database

As noted above, any tickets created before a custom field has been defined will not have a value for that field. Here's a bit of SQL (tested with SQLite) that you can run directly on the Trac database to set an initial value for custom ticket fields. Inserts the default value of 'None' into a custom field called 'request_source' for all tickets that have no existing value: