Modify

Opened 8 years ago

Last modified 4 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

Description

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 8 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(z.group("ti"),z.group("bs")))

def get_link_resolvers(self):

return []

def _format_symbol(self, i, bugscheme):

bugzilla_url= self.env.config.get('bugzilla', 'bugzilla_url', 'http://tutoo.las.ic.unicamp.br/bugzilla'); if (bugscheme == " #"):

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

else:

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

comment:2 Changed 4 years ago by manuel@…

A working solution for this is to use the RegexLinkPlugin (http://trac-hacks.org/wiki/RegexLinkPlugin) with the following configuration:

[regexlink]
regex1=\bbug (?P<bug_id_comment>\d+) comment #(?P<commentid>\d+)\b
url1=http://your.trac.instance.com/ticket/\g<bug_id_comment>#comment:\g<commentid>
regex2=\bbug (?P<bug_id>\d+)\b
url2=http://your.trac.instance.com/ticket/\g<bug_id>

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

Add Comment

Modify Ticket

Action
as new The owner will remain javajunky.
Author


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

 
Note: See TracTickets for help on using tickets.