Stephen Ostermiller's Blog

Bugzilla – Setting ‘Target Milestone’ During Bug Creation

I'm a fan of the Bugzilla bug tracking system that came out of the Mozilla web browser project. It is a web based system that makes it pretty easy to track issues with pretty much any piece of software. Furthermore, it isn't that hard to set up, so I have used it in more than one employment setting.

At work, we have a private Bugzilla installation that is only visible to employees. Given that everybody that can enter bugs should know how to fill in even the more complex fields, the enter bug form seemed a little inadequate. Our QA department really wanted to be able to specify the target milestone for a new bug to be for the next release when they entered a bug for a regression during the full quality assurance check a few days before a release.

A target milestone that can be set at the time of bug creation is now a standard feature in Bugzilla. These modifications are no longer needed as of Bugzilla 2.20.

Fortunately, Bugzilla is pretty easy to modify Bugzilla to do your bidding. I was able to change just a few lines in each of two files to add this field to the enter_bug form. This patch makes a few assumptions that may not be applicable to all Bugzilla installations:

  • We have a default target milestone of '---' which is hardcoded into enter_bug.cgi.
  • All users should be able to set the target milestone.
  • We have only one product, so I haven't tested this with multiple products with different target milestones for each.
  • This is only available in English (only the template for English has been modified).
  • No documentation changes were made to help users that want to know what a target milestone actually is.
  • There is no configuration parameter for the administrator to turn this off.

Given these limitations I'm choosing to post my changes here in hopes that somebody will find them useful rather than trying to get them into the Bugzilla code base. The following patch is against Bugzilla 2.18 (the latest stable release as of this writing). The patch is given in context diff form. If you want to apply this patch to your Bugzilla installation, but are unfamiliar with the mechanics, you should be able to open enter_bug.cgi and create_html.tmpl and add the lines that have a plus sign in front of them below.

Index: enter_bug.cgi
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v
retrieving revision 1.94.2.2
diff -w -c -c -r1.94.2.2 enter_bug.cgi
*** enter_bug.cgi       7 Jan 2005 20:31:42 -0000       1.94.2.2
--- enter_bug.cgi       22 Mar 2005 13:38:47 -0000
***************
*** 50,55 ****
--- 50,56 ----
    @legal_priority
    @legal_severity
    @legal_keywords
+   @legal_target_milestone
    $userid
    %versions
    $proddesc
***************
*** 278,283 ****
--- 279,287 ----
  $vars->{'bug_severity'} = \@legal_severity;
  $default{'bug_severity'} = formvalue('bug_severity', 'normal');

+ $vars->{'target_milestone'} = \@legal_target_milestone;
+ $default{'target_milestone'} = formvalue('target_milestone','---');
+
  $vars->{'rep_platform'} = \@legal_platform;
  $default{'rep_platform'} = pickplatform();

Index: template/en/default/bug/create/create.html.tmpl
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl,v
retrieving revision 1.30.2.3
diff -w -c -c -r1.30.2.3 create.html.tmpl
*** template/en/default/bug/create/create.html.tmpl     7 Jan 2005 20:31:43 -0000       1.30.2.3
--- template/en/default/bug/create/create.html.tmpl     22 Mar 2005 13:38:47 -0000
***************
*** 159,164 ****
--- 159,171 ----
    </tr>

    <tr>
+  <td></td> <td></td>
+   [% sel = { description => 'Target Milestone', name => 'target_milestone' } %]
+   [% INCLUDE select %]
+   </tr>
+
+
+   <tr>
      <td>&nbsp;</td>
      <td colspan="3"></td>
    </tr>

Leave a comment

Your email address will not be published. Required fields are marked *