Customizing the Trac workflow
Trac is an enhanced wiki and issue tracking system for software development projects. It integrates your changesets in source repository, roadmap, continuous integration and much more. For a standard installation, tickets in Trac follow a basic workflow which you can see below. The problem with this state diagram is, that there is no explicit Q&A stage. Developers close tickets, and testers re-open them. But when you are using Scrum, you want to finish your sprint with all tickets ready for testing.

Luckily, this is easy to do in Trac since version 0.11 ...
Here's the diagram we would like to implement :

As you can see in the diagram, we also opted for a reviewing phase before going into Q&A. This is a quick pre-testing by collegue-developers so the obvious bugs can still be fixed within the sprint. This way of working avoids that very obvious mistakes cause two sprints delay for important features/tickets.
Now go to your trac project directory - /opt/trac/projects/<my-project> or the likes - and open up "conf/trac.ini". Pasting the following configuration section in there :
[ticket-workflow]
accept = new -> assigned
accept.operations = set_owner_to_self
accept.permissions = TICKET_MODIFY
leave = * -> *
leave.default = 1
leave.operations = leave_status
reassign = new,assigned,reopened -> new
reassign.operations = set_owner
reassign.permissions = TICKET_MODIFY
reopen = closed,qa,reviewing -> reopened
reopen.operations = del_resolution
reopen.permissions = TICKET_CREATE
close = new,assigned,reopened,reviewing,qa -> closed
close.operations = set_resolution
close.permissions = TICKET_MODIFY
ready_for_review = new,assigned,reopened -> reviewing
ready_for_review.permissions = TICKET_MODIFY
ready_for_qa = new,assigned,reopened,reviewing -> qa
ready_for_qa.permissions = TICKET_MODIFY
Now, run the following command :
root@trac:/opt/trac/projects/# trac-admin /opt/trac/projects/<my-project>/ upgrade
When creating a new ticket workfow, contrib/workflow/workflow_parser.py is supposed to create .dot files that GraphViz understands to provide a visual description of the workflow. But i did not get it to work out-of-the-box so I've drawn the state diagram myself with dia.
This article still lacks a follow up on how to configure your roadmap so the sprint completion percentage is counted using the new ticket states. Soon to come !
Follow up :
To get your roadmap and statistics right, add this snippet to your trac.ini :
[milestone]
stats_provider = DefaultTicketGroupStatsProvider[roadmap]
stats_provider = DefaultTicketGroupStatsProvider[milestone-groups]
closed = closed, reviewing, qa
closed.order = 0
closed.query_args = group=resolution
closed.overall_completion = true
closed.label=Closed/QA
closed.css_class = closedin_progress = new,assigned
in_progress.order = 1
in_progress.query_args = group=resolution
in_progress.label = In progress
in_progress.css_class = newactive = * # one catch-all group is allowed
active.order = 2
active.css_class = new # CSS class for this interval
active.css_class = open
active.label=New
