Table Of Contents

Previous topic

trac.mimeview.api – Trac content transformation APIs

Next topic

trac.util – General purpose utilities

This Page

trac.ticket.roadmap – The Roadmap and Milestone modules

The component responsible for the Roadmap feature in Trac is the RoadmapModule. It provides an overview of the milestones and the progress in each of these milestones.

The component responsible for interacting with each milestone is the MilestoneModule. A milestone also provides an overview of the progress in terms of tickets processed.

The grouping of tickets in each progress bar is governed by the use of another component implementing the ITicketGroupStatsProvider interface. By default, this is the DefaultTicketGroupStatsProvider (for both the RoadmapModule and the MilestoneModule), which provides a configurable way to specify how tickets are grouped.

Interfaces

class trac.ticket.roadmap.ITicketGroupStatsProvider

See also trac.ticket.roadmap.ITicketGroupStatsProvider extension point

get_ticket_group_stats(ticket_ids)

Gather statistics on a group of tickets.

This method returns a valid TicketGroupStats object.

class trac.ticket.roadmap.TicketGroupStats(title, unit)

Encapsulates statistics on a group of tickets.

Parameters:
  • title – the display name of this group of stats (e.g. 'ticket status')
  • unit – is the units for these stats in plural form, e.g. _('hours')
add_interval(title, count, qry_args, css_class, overall_completion=None)

Adds a division to this stats’ group’s progress bar.

Parameters:
  • title – the display name (e.g. 'closed', 'spent effort') of this interval that will be displayed in front of the unit name
  • count – the number of units in the interval
  • qry_args – a dict of extra params that will yield the subset of tickets in this interval on a query.
  • css_class – is the css class that will be used to display the division
  • overall_completion – can be set to true to make this interval count towards overall completion of this group of tickets.

Changed in version 0.12: deprecated countsToProg argument was removed, use overall_completion instead

Components

class trac.ticket.roadmap.MilestoneModule

View and edit individual milestones.

stats_provider

Name of the component implementing ITicketGroupStatsProvider, which is used to collect statistics on groups of tickets for display in the milestone views.

class trac.ticket.roadmap.RoadmapModule

Give an overview over all the milestones.

stats_provider

Name of the component implementing ITicketGroupStatsProvider, which is used to collect statistics on groups of tickets for display in the roadmap views.

class trac.ticket.roadmap.DefaultTicketGroupStatsProvider

Configurable ticket group statistics provider.

See TracIni#milestone-groups-section for a detailed example configuration.

Helper Functions

trac.ticket.roadmap.apply_ticket_permissions(env, req, tickets)

Apply permissions to a set of milestone tickets as returned by get_tickets_for_milestone().

trac.ticket.roadmap.get_tickets_for_milestone(env, db=None, milestone=None, field='component')

Retrieve all tickets associated with the given milestone.

Changed in version 1.0: the db parameter is no longer needed and will be removed in version 1.1.1

trac.ticket.roadmap.grouped_stats_data(env, stats_provider, tickets, by, per_group_stats_data)

Get the tickets stats data grouped by ticket field by.

per_group_stats_data(gstat, group_name) should return a data dict to include for the group with field value group_name.