Version 17 (modified by 13 years ago) (diff) | ,
---|
Contents
Support for pseudo child-tickets and a visual reference to these within a parent ticket.
Description
Some time ago I came across the problem of how to manage child tickets in a meaningful fashion, we were using coderanger's original MasterTicketsPlugin and it was great until we started to allow tickets to be viewed and created by people outside of our immediate development group. We found that people who were not familiar with our processes would simply create child tickets of the wrong 'type' and needed some help in getting it right. In addition, users found that the lack of visual information (ie. what are this tickets child tickets?) was also a hindrance.
Having child-tickets is extremely useful when it comes to managing multiple releases (ie. a single 'bug-report' ticket and a single 'bug-fix' ticket for each milestone/branch of development), for managing sub-tasks of an issue and for managing 'bug-fixes' required when developing a new (larger) enhancement.
This plugin modifies the ticket description box and adds a child ticket listing table and a 'create' button for adding new child tickets. It has the following features:
It is possible to control in trac.ini the following aspects of child-ticket creation/viewing:
- allow/disallow child-tickets for a certain type of ticket
- to define the table headers displayed in the parent ticket
- to define a default for the child type to be created / restrict the type of child-tickets
- to define which fields are inherited by child-tickets
Under Trac 0.10 I had to modify the ticket.html templates to get this working in any 'pretty' sense so I have not provided support for 0.10. As of 0.11, the ITemplateStreamFilter allows this to be incorporated nicely into a neat plugin.
In order to keep the plugin as compact and simple as possible and to allow future compatibility with different CSS schemes, I have simply 'pinched' the existing CSS classes for generating the table and its components.
NOTE: The configurability of this plugin has been ported to the Subtickets plugin. See the patches in issues 9-12 at github. -- Chris Nelson
Configuration
The plugin makes use of the 'ticket-custom' field and so requires no extra db tables to be created. The following fields are required in the 'trac.ini' (see table below for a generic description of the options):
[components] childtickets.* = enabled childtickets.childtickets.tracchildticketsmodule = enabled [ticket-custom] parent = text parent.format = wiki parent.label = Parent ID [childtickets] # 'enhancements' : child tickets will typically be bug-fix tickets with the same milestone, component and keywords. parent.enhancement.allow_child_tickets = true parent.enhancement.restrict_child_type = bug-fix, task parent.enhancement.table_headers = type, status, owner, summary parent.enhancement.inherit = milestone, component, keywords # 'bug-report' : child tickets will typically be bug-fix parent.bug-report.allow_child_tickets = true parent.bug-report.default_child_type = bug-fix parent.bug-report.table_headers = type, priority, owner, summary, milestone parent.enhancement.inherit = component, keywords # 'issue' : child tickets will typically be task tickets with no default milestone. parent.issue.allow_child_tickets = true parent.issue.restrict_child_type = task parent.issue.table_headers = type, status, owner, summary, milestone # 'bug-fix' : child tickets are not allowed. parent.bug-fix.allow_child_tickets = false # 'task' : child tickets are not allowed. parent.task.allow_child_tickets = false
[childtickets]
parent.<parent-type>.allow_child_tickets | Define whether child tickets are allowed or not | Default: False |
parent.<parent-type>.table_headers | List of column headers for display in parent ticket | Default: summary, owner |
parent.<parent-type>.default_child_type | Default child type | Default: See [ticket] section of trac.ini (default_type) |
parent.<parent-type>.restrict_child_type | A list of possible child types, trying to create a child of a different 'type' will create an error. As of version 1.1.0, if this option is used, a list of submit buttons will be rendered allowing the user to decide which type of child ticket he/she wants to create. | Default: None |
| | |
parent.<parent-type>.inherit | Define a list of inherited fields. | Default: None |
default.max_depth | Limit the creation of too deep a hierarchy. | Default: 5 |
Issues / Caveats
- If you change the behaviour of the parent type (using for example allow_child_tickets/restrict_child_type) and tickets already have child tickets assigned to them you will not receive a warning about any possible conflicts until you try and modify any of the child tickets.
- If a parent ticket is restricted in some way that no further child tickets can be generated for that ticket 'type', you'll continue to see a list of child tickets but the 'Create' button will be missing.
- The 'parent.<type>.inherit' option ensures fields are inherited by child tickets, However, all child tickets (regardless of type as defined by 'restrict_child_type') will inherit these values.
Bugs/Feature Requests
Existing bugs and feature requests for ChildTicketsPlugin are here.
If you have any issues, create a new ticket.
Download
Download the zipped source from [download:childticketsplugin here].
Source
You can check out ChildTicketsPlugin from here using Subversion, or browse the source with Trac.
NOTE: New 'look and feel' For 0.12
Since trac 0.12 has the nice looking 'collapsible' areas for 'Attachments' and 'Modify Ticket' sections, I have decided to use these for the child ticket tables. It is now possible (and looks much nicer, I think!) to hide the child tickets as they are incorporated into there own collapsible section.
Example
Handling multiple bug-fixes for single bug-report
In my last job using trac with svn, we had a branch of development for each milestone of development plus a 'special' milestone to assign for hotfix/patches. Rather than creating a single 'bug-fix' ticket and commenting on the ticket that the fix had been applied to milestone X on branch X, milestone Y on branch Y, etc..., we would create a single 'bug-report' ticket (with version info but no milestone) and this ticket would, after assessment from developers/project-mgr, have a bug-fix child-ticket created per milestone - each with its own life-cycle, priority, (sometimes) developer, etc ...
Handling sub-tasks from a single issue
Probably self explanatory: you have something that needs to be done by several different people. Split it up into sub-tasks.
A New Feature generates bugs
When developing a new feature (a single ticket), our developers would 'finish' the feature and pass it to our testing department. The feature, on the whole, might be OK but require several days testing. Within that time several bugs are generated as a direct result of this new feature. It makes no sense to pass the original feature ticket back to the developers (the feature has not been 'rejected' and is still in testing!), so instead, the testing tem can make 'bug-fix' child-tickets for this parent ticket. The feature might even be released with known bugs but at least they're recorded and owned by someone/somewhere!
Using the 'parent.type.restrict_child_type' Option
If you are using the above option, the available child types will be rendered as individual buttons.
Creating a Progress Bar for Child Tickets
If you have a lot of child tickets for one parent, and want an overview of those tickets, you can use the ProgressMeterMacro as provided by qwpO. In order to use this, simply provide the 'parent' as the only search query. For example, if you put the following macro definition in your ticket description:
[[ProgressMeterMacro(parent=#1)]]
Then the following will appear in the ticket description:
Recent Changes
- 18437 by Cinc-th on 2021-07-09 12:02:20
-
ChildTicketsPlugin: let user hide the description and table headers of child tickets using a preferences form. The preferences are saved similar to other ticket preference settings.
Closes #14036
- 18129 by Cinc-th on 2021-04-01 11:50:46
-
ChildTicketsPlugin: fix exception with admin pages when table header configuration referenced a ticket custom field which wasn't defined. Similar to [18126] but resolved differently.
- 18128 by Cinc-th on 2021-04-01 10:38:07
-
ChildTicketsPlugin: allow to specify a label for the ticket custom field
parent
when configured from the admin page.
- 18127 by Cinc-th on 2021-03-31 20:17:47
-
ChildTicketsPlugin: properly wikify content of text fields in child tables if field format is set to wiki.
An example is the parent ticket custom field which now has proper links to parent tickets.
- 18126 by Cinc-th on 2021-03-31 19:24:00
-
ChildTicketsPlugin: fix exception when table header configuration referenced a ticket custom field which wasn't defined.
(more)
Author/Contributors
Attachments (8)
- bug-report-example.jpg (45.7 KB) - added by 14 years ago.
- issue-example.jpg (34.3 KB) - added by 14 years ago.
- MultipleChildType.png (7.1 KB) - added by 13 years ago.
-
progmeter_ticket.png (27.4 KB) - added by 13 years ago.
The ProgressMeterMacro also provides some nice features
- NewChildTicketTable.png (40.1 KB) - added by 13 years ago.
-
childtickets-ticket-page.png (184.5 KB) - added by 3 years ago.
Screenshot of child ticket tree on ticket page.
-
childtickets-admin-type.png (135.7 KB) - added by 3 years ago.
Screenshot of admin page for ticket type defect.
-
childtickets-custom-field.png (92.3 KB) - added by 3 years ago.
Screenshot of admin page for creating ticket custom field parent
Download all attachments as: .zip