Edgewall Software

Customising Trac Roadmap Ticket Groups

By default, the roadmap shows a list of future milestones with the tickets targeted against a milestone aggregated, and the ratio between active and resolved tickets displayed as a milestone progress bar. For the default workflow this is often sufficient, however with the ability to create custom workflows, it becomes necessary to be able to show further detail on the roadmap progress bar.

Trac roadmap with multiple groups

Configuring the roadmap to show additional groupings in the progress bar is achieved by editing the trac.ini file. This file should already have a section which reads:

[milestone]
stats_provider = DefaultTicketGroupStatsProvider

In order to change the default grouping, which simply counts tickets as either 'closed' or 'active', we need to add a new section to trac.ini entitled [milestone-groups]. In this example we add a new group for the 'in_QA' status, included in the custom workflow.

[milestone-groups]
# The definition consists in a comma-separated list of accepted status.
# Also, '*' means any status and could be used to associate all remaining
# states to one catch-all group.
# Qualifiers for the above group (the group must have been defined first):

# Definition of a 'closed' group:
closed = closed
closed.order = 1
closed.query_args = group=resolution
closed.overall_completion = true 

# Definition of an 'in testing' group:                                 
inQA = in_QA
inQA.order = 2
inQA.css_class = new
inQA.label = in testing

# Definition of an 'active' group:
active = *
active.order = 3
active.css_class = open
active.label = in progress

# The CSS class can be one of: new (yellow), open (no color) or
# closed (green). New styles can easily be added using the following
# selector:  `table.progress td.<class>`

The following parameters are used in the [milestone-groups] section:

<groupname>A comma separated list of statuses that match this group. The '*' can be used once and will match all statuses not yet assigned
<groupname>.orderThe sequence number in the progress bar
<groupname>.query_argsOptional extra parameter for the query
<groupname>.overall_completiontrue/false - count in the overall completion statistic
<groupname>.css_classCSS class to use for this interval, defaults available are: new (yellow), open (no color) or closed (green). New styles can easily be added using the following selector: table.progress td.<class>
<groupname>.labelDisplayed name for the group

See also: TracRoadmap, TracTickets, TracIni, CookBook/Configuration/Workflow

Last modified 4 years ago Last modified on May 1, 2012, 7:20:14 AM

Attachments (1)

Download all attachments as: .zip