Version 7 (modified by Rob Guttman, 13 years ago) (diff)


Default and convert report dynamic variables to pulldowns


This plugin applies to all reports that use dynamic variables. The plugin does two things for dynamic variables whose (uppercase) name exactly matches a built-in or custom (lowercase) select field name:

  • Dynamic variables are set to default values if unset
  • The text fields for dynamic variables are converted to pulldown menus

JavaScript is required for the second feature above.


  1. Install the plugin (after downloading and unzipping):
    cd dynamicvariablesplugin/0.12
    sudo python bdist_egg
    sudo cp dist/TracDynamicVariables*.egg /your/trac/location/plugins/

See TracPlugins for more installation details and options. You'll likely need to restart Trac's web server after installation.

  1. Enable the plugin:
    dynvars.* = enabled

You can alternatively use the Trac Web Admin GUI to enable any or all rules.

  1. Create/modify reports so that the name used for dynamic variables exactly match the name of the select field that it corresponds to. See an example below.

Bugs/Feature Requests

Existing bugs and feature requests for DynamicVariablesPlugin are here.

If you have any issues, create a new ticket.


Download the zipped source from [download:dynamicvariablesplugin here].


You can check out DynamicVariablesPlugin from here using Subversion, or browse the source with Trac.


The only configuration options are in defining SQL reports. For example, a report for a specific milestone that also queries for a custom queue select field could be defined like this:

SELECT p.value AS __color__, AS ticket, summary, component, severity, reporter
  FROM ticket t
  LEFT OUTER JOIN milestone m ON t.milestone =
  LEFT JOIN enum p ON = t.severity AND p.type = 'severity'
  LEFT OUTER JOIN ticket_custom q ON q.ticket = and = 'queue'
  WHERE q.value = '$QUEUE'
    AND milestone = '$MILESTONE'
  ORDER BY m.due ASC, p.value

Here's what this report would look like both before and after this plugin is installed and enabled:



Recent Changes

16587 by rjollos on 2017-05-14 15:31:58
1.2.0dev: Restore argument unintentionally removed in r16586
16586 by rjollos on 2017-05-13 17:41:52
1.2.0dev: Add branch compatible with Trac 1.2
15377 by rjollos on 2016-03-01 01:15:59
0.2.0dev: Fix empty select with Trac 0.12

Patch by Jun Omae.

Fixes #12679.



Author: robguttman
Maintainer: robguttman

Attachments (2)

Download all attachments as: .zip