Sean McAfee etzwane at
Wed Oct 1 23:15:24 UTC 2003

<jose at> wrote:
>I would like to integrate my app with bugzilla but prefer not to use the
>generated html output from bugzilla.  Is there a backend interface to
>bugzilla where I can just post queries and get plain text responses that I
>can parse and display as I need?

I've created an interface that works like this:

my $iterator = bug_iterator(
    product => 'Some Product',
    where => [
        #  Can say "OR" here to get a disjunction instead of a conjunction
        [ 'bug_file_loc', 'regexp', 'ba[rz]\.com' ],
        [ 'priority', 'anywords', 'P3', 'P4', 'P5' ],
        [ 'int_custom_field', '>', 1000 ],
        [ 'any comment', 'substring', 'foo' ]
    notes => 'yes',       # include comments
    attachments => 'yes'  # include attachments

while (my $bug = $iterator->()) {
    print "Found bug $bug->{bug_id}:\n\n";
    print "'Custom String Field' is '$bug->{custom_string_field}'.\n\n";
    for my $note (@{ $bug->{notes} }) {
        print "Note from $note->{who}:\n";
        print $note->{thetext}, "\n\n";
    for my $attach (@{ $bug->{attachments} }) {
        print "Attachment of type $attach->{mimetype} ";
        print "created $attach->{creation_ts}\n";
        print $attach->{thedata}, "\n\n"
            if $attach->{mimetype} eq 'text/plain';

It works really well; I can pull data out in seconds that takes hours to
retrieve from our legacy system (TeamTrack).  Unfortunately I've been
spending all my time recently frantically converting my company's incident
database from TT to BZ, and haven't been able to work on garnering
acceptance for my custom field implementation and related modules like the
bug iterator.

Now that I think about it, though, I reckon it should be fairly easy
to gut the custom field bits from the iterator code and be left with
something that will work on a stock Bugzilla installation.  Would anyone
like to have something like that?


More information about the developers mailing list