Opened 10 years ago

Last modified 6 years ago

#571 new enhancement

Allow links to legacy Bugzilla tickets

Reported by: r.d.wilkerson@… Owned by: javajunky
Priority: normal Component: BugzillaIssueTrackingPlugin
Severity: minor Keywords:
Cc: Trac Release: 0.9


We're in the process of moving from Bugzilla to Trac and have made the decision not to import existing bugs to prevent the introduction of a lot of garbage into our shiny new Trac installation. Instead, we'll be using TracTickets for new bugs and simply referencing Bugzilla for legacy bug entries. It would be great if we could access either through Trac. Perhaps retaining the "#" notation for referencing Trac tickets and adding "BZ#" notation for Bugzilla tickets?

Of course, I have no idea whether this is possible, but it would be a really nice addition.

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by felmasper

If you are moving your svn into Trac, then you need to change commit messages, this will be a hard work.

This is an example of how to accept other forms. You must have a space before # for Trac tickets to work. I didn't test this code... I don't even remember if it's "or" or "
" in Python :-) You get the idea...

def get_wiki_syntax(self):

yield ("(?P<bs>BZ#| #)(?P<ti>\d+)", lambda x, y, z: self._format_symbol("ti"),"bs")))

def get_link_resolvers(self):

return []

def _format_symbol(self, i, bugscheme):

bugzilla_url= self.env.config.get('bugzilla', 'bugzilla_url', ''); if (bugscheme == " #"):

return " <a rel='nofollow' class='ticket' href='ticket/%s'>#%s</a>" % (i, i);


return "<a rel='nofollow' class='ticket' href='%s/show_bug.cgi?id=%s'>BZ#%s</a>" % (bugzilla_url, i, i);

comment:2 Changed 6 years ago by manuel@…

A working solution for this is to use the RegexLinkPlugin ( with the following configuration:

regex1=\bbug (?P<bug_id_comment>\d+) comment #(?P<commentid>\d+)\b
regex2=\bbug (?P<bug_id>\d+)\b

This will correctly link all bug X and bug X comment Y links to the equivalent trac URLs

Add Comment

Modify Ticket

as new The owner will remain javajunky.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.