WWW::Bugzilla(3pm)

πŸ“¦
version 1.5 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

okay so bestie, meet WWW::Bugzilla πŸ¦‹ β€” she handles submission/update of bugzilla bugs via WWW::Mechanize. That's the whole vibe. She's your perl bestie who files bugs for you so you don't have to click through forms like it's 2009. πŸ’…


🌸 SYNOPSIS 🌸

    use WWW::Bugzilla;

    # create new bug
    my $bz = WWW::Bugzilla->new(    server => 'www.mybugzilla.com',
                                    email => 'buguser@bug.com',
                                    password => 'mypassword' );

    # enter info into some fields and save new bug

    # get list of available version choices
    my @versions = $bz->available('version');

    # set version
    $bz->version( $versions[0] );

    # get list of available products
    my @products = $bz->available('product');

    # set product
    $bz->product( $products[0] );

    # get list of components available
    my @components = $bz->available('component');

    # set component
    $bz->component( $components[0] );

    # optionally do the same for platform, os, priority, severity.

    $bz->assigned_to( 'joeschmoe@whatever.com' );
    $bz->summary( $some_text );
    $bz->description( $some_more_text );

    # submit bug, returning new bug number
    my $bug_number = $bz->commit;

    # all of the above could have been done in a much easier
    # way, had we known what values to use. See below:

    my $bz = WWW::Bugzilla->new(    server => 'www.mybugzilla.com',
                                    email => 'buguser@bug.com',
                                    password => 'mypassword'
                                    version => 'Alpha',
                                    product => 'MyProduct',
                                    component => 'API',
                                    assigned_to => 'joeschmoe@whatever.com',
                                    summary => $some_text,
                                    description => $some_more_text);

    my $bug_number = $bz->commit;

    # Below is an example of how one would update a bug.

    my $bz = WWW::Bugzilla->new(    server => 'www.mybugzilla.com',
                                    email => 'buguser@bug.com',
                                    password => 'mypassword'
                                    bug_number => 46 );

    # show me the chosen component
    my $component = $bz->component;

    # change component
    $bz->component( 'Test Failures' );

    $bz->add_cc( 'me@me.org' );

    $bz->add_attachment(    filepath => '/home/me/file.txt',
                            description => 'description text',
                            is_patch => 0,
                            comment => 'comment text here' );

    $bz->additional_comments( "comments here");

    # below are examples of changing bug status
    $bz->change_status("assigned");
    $bz->change_status("fixed");
    $bz->change_status("later");
    $bz->mark_as_duplicate("12");
    $bz->reassign("someone@else.com");

    $bz->commit;

like, look at her go πŸƒβ€β™€οΈπŸ’¨ two whole ways to file a bug and a whole little glow-up routine for updating one. obsessed.


πŸŽ€ DESCRIPTION πŸŽ€

Right now, WWW::Bugzilla gives you an API for posting brand-new Bugzilla bugs, and also for updating the Bugzilla bugs that already exist. That's it, that's the gig. ✨


πŸ”₯ INTERFACE πŸ”₯

πŸ’œ METHODS πŸ’œ

new()

Sets up your WWW::Bugzilla object, bestie. If you pass in bug_number, she'll set herself up as an existing bug instead of a fresh one.

Heads up: she will croak() unless the Bugzilla login page on the server you named comes back with a 200 or a 404. No 200, no 404, no vibes. 😭

new() supports these name-value params:

  • server (required) β€” the URL of the bugzilla server you wanna talk to. Do not put http:// or https:// in front of the url (peep the use_ssl option below for that whole situation). πŸ‘‘
  • email (required) β€” your email address as bugzilla knows it. i.e. your bugzilla login. 🫢
  • password (required) β€” your Bugzilla password. keep it secret, keep it safe. 🀫
  • use_ssl (optional) β€” if you set it, she'll use the https:// protocol instead; defaults to http://.
NOTE: this option needs Crypt::SSLeay. no module, no ssl, no cap. πŸ’€
  • product β€” the Bugzilla product name. required if you're entering a new bug (not updating one).
  • bug_number (optional) β€” if your whole plan is to update an existing bug (not create a new one), drop a valid bug number right here. πŸ›
  • version component status assigned_to resolution dup_id assigned_to summary bug_number description os platform severity priority cc url add_cc target_milestone status_whiteboard keywords depends_on blocks additional_comments β€” these are the fields you can initialize straight in new(), which is super handy for new bugs. pls note: some of these fields only apply to bugs that are being updated, and if you set them here they'll get overridden if the value is already set in the actual bug on the server. These fields also each have their own get/set methods (scroll down, bestie πŸ‘‡).

product() version() component() status() assigned_to() resolution() dup_id() assigned_to() summary() bug_number() description() os() platform() severity() priority() cc() url() add_cc() target_milestone() status_whiteboard() keywords() depends_on() blocks() additional_comments()

get/set the value of these bug fields. some of them apply only to new bugs, some only to bugs being updated. and commit() must be called to actually save these permanently β€” setting them is just the talking stage, fr fr. πŸ’…

available()

Returns a list of the available options for the field you asked about. Here are the known valid fields:

product platform os version priority severity component target_milestone

so many choices, so little time. 🌈

product()

Sets the Product for the bug. simple, iconic.

reassign()

Marks the bug you're updating as reassigned to another user. Takes an email address as its parameter. Status/resolution will not be updated until commit() is called. πŸ‘‘

mark_as_duplicate()

Marks the bug you're updating as a duplicate of another bug number. Takes a bug number as its argument. Status/resolution will not be updated until commit() is called. twins fr. πŸ‘―

change_status()

Changes the status of the bug you're updating. Status/resolution will not be updated until commit() is called. These are the valid options (case-insensitive, bestie):

assigned fixed invalid wontfix later remind worksforme reopen verified closed

pick your fighter. πŸ₯Š

add_attachment()

Adds an attachment to an existing bug β€” will not work for new bugs. Here are the params you've got:

  • filepath (required)
  • description (required)
  • is_patch (optional boolean)
  • content_type β€” autodetected if you don't define it.
  • comment (optional)
  • finished β€” will not return object to update form if set (optional boolean)

list_attachments()

Lists the attachments that are attached to an existing bug β€” will not work for new bugs.

get_attachment()

Gets the specified attachment from an existing bug β€” will not work for new bugs.

obsolete_attachment()

Marks the specified attachment obsolete β€” will not work for new bugs. not me being obsolete πŸ’€

commit()

Submits the bugzilla new-or-update form. Returns bug_number. Optionally takes the parameter finished β€” if you set it, you're done updating the bug and she won't return you to the update page. (the original spells this out a lil goofy, but the meaning is: finished = no more round trips. 😌)

check_error ()

Checks if an error was given, croaking if it was. she's not gonna let it slide. πŸ™ˆ

get_products ()

Gets a list of products. πŸ’–

get_comments()

Lists comments made on an existing bug β€” will not work for new bugs.


πŸ¦‹ BUGS, IMPROVEMENTS πŸ¦‹

ngl, there may well be bugs in this module. πŸ‘€ Using it the way the author has, they just have not run into any. Also, this module does not support ALL of Bugzilla's features β€” it's giving "greatest hits," not "complete discography."

Any patches or improvements will be considered! Just send an email to the address listed below. bestie energy only, pls. 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Maintained by:

  • Brian Caswell, bmc@shmoo.com

Originally written by:

  • Matthew C. Vella, the_mcv@yahoo.com

🌸 LICENSE 🌸

  WWW::Bugzilla - Module providing API to create or update Bugzilla bugs.
  Copyright (C) 2003 Matthew C. Vella (the_mcv@yahoo.com)

  Portions Copyright (C) 2006 Brian Caswell (bmc@shmoo.com)

  This module is free software; you can redistribute it and/or modify it
  under the terms of either:

  a) the GNU General Public License as published by the Free Software
  Foundation; either version 1, or (at your option) any later version,
  or

  b) the "Artistic License" which comes with this module.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See either
  the GNU General Public License or the Artistic License for more details.

  You should have received a copy of the Artistic License with this
  module, in the file ARTISTIC.  If not, I'll be glad to provide one.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  USA

and that's the whole page, bestie!! πŸ’– this was perl v5.32.0, dated 2021-01-07, straight out of the WWW::Bugzilla(3pm) manual β€” mwah, go file some bugs, you absolute icon πŸ‘‘βœ¨πŸŽ€

πŸ“¦ where this page comes from