Bugzilla::OO - Object Oriented interface to Bugzilla's bug database
use Bugzilla::OO;
# Log in as user@example.com
my $session = Bugzilla::OO->new( 'user@example.com' );
# Close out bug 471
my $bug = $session->get_bug( 471 );
$bug->add_comment( "This bug is fixed" );
$bug->set_assigned_to( 'user2@example.com' );
$bug->set_status( 'RESOLVED' );
$bug->set_resolution( 'FIXED' );
$bug->send_mail();
The Bugzilla::Bug object is very difficult to work with outside of the web server tree. It doesn't give easy access to the database fields, requiring most users to write their own raw SQL commands. This is a bad thing, since it exposes far more of the database than the users should know about.
Additionally, there are many operations that requiring multiple tables to be updated. If the user doesn't know that the activity log must be updated when the status field is changed, well, then you lose that data. These object methods keep everything in sync so that you do not need to know about the multiple phases of the operations.
This package encapsulates many common bug operations (setting fields, marking duplicates, closing bugs, etc). It doesn't do all of them yet, but it is still a work in progress.
newget_bugqueryexecute%queries hash table as strings until
they are used for the first time, at which point they will be compiled
with DBI::prepare to speed up future executions.
The Bug object is a subclass in the Bugzilla::OO tree that has the
methods for dealing with bugs.
set_time_stampget_bug_by_id or get_bug_by_alias,
so you should not have to call it again unless you want to set the time
to something else.
add_commentadd_attachmentset_activityset_assigned_toset_bug_statusAllowable status values are:
ASSIGNED
CLOSED
NEW
REOPENED
RESOLVED
UNCONFIRMED
VERIFIED
set_resolution
DUPLICATE
FIXED
INVALID
LATER
MOVED
REMIND
WONTFIX
WORKSFORME
get_duplicatemark_duplicate
Many. This is still a work in progress