BZ::Client::Component - Client side representation of Product Components in Bugzilla
version 4.4002
This class provides methods for accessing Product Component information in the Bugzilla server.
my $client = BZ::Client->new( url => $url, user => $user, password => $password ); my $id = BZ::Client::Component->create( $client, \%params ); my $changes = BZ::Client::Component->update( $client, \%params ); my $ids = BZ::Client::Component->delete( $client, \%params );
This section lists the class methods, which are available in this module.
$id = BZ::Client::Component->create( $client, \%params );
Returns the ID of the newly created Component.
Added in Bugzilla 5.0.
Marked experiemental as of Bugzilla 5.0.
Some params must be set, or an error will be thrown. These params are marked "Required".
name (string) The name of the new component.
Required.
product (string) The name of the product that the component must be added to. This product must already exist, and the user have the necessary permissions to edit components for it.
description (string) The description of the new component.
default_assignee (string) The login name of the default assignee of the component.
default_cc (array) An array of strings with each element representing one login name of the default CC list.
default_qa_contact (string) The login name of the default QA contact for the component.
is_open (boolean) 1 if you want to enable the component for bug creations. 0 otherwise. Default is 1.
1
0
The ID of the newly-added component.
You are not authorized to create a new component.
The name that you specified for the new component already exists in the specified product.
$changes = BZ::Client::Component->update( $client, \%params ); @changes = BZ::Client::Component->update( $client, \%params );
This allows you to update one or more components in Bugzilla.
You must set one or both of "ids" or "names" to select the Component to update.
Other parameters set or update values of the Component
ids (array) Numeric ID's of the components that you wish to update.
names (array of hashes) Names of the components that you wish to update. The hash keys are product and component, representing the name of the product and the component you wish to change.
product
component
name (string) A new name for this component. If you try to set this while updating more than one component for a product, an error will occur, as component names must be unique per product.
is_open (boolean) 1 if you want to enable the component for bug creations. 0 otherwise.
An array of hashes with the following fields:
id (int) The ID of the component that was updated.
The changes that were actually done on this component. The keys are the names of the fields that were changed, and the values are a hash with two keys:
added (string) The value that this field was changed to.
removed (string) The value that was previously set in this field.
Note that booleans will be represented with the strings 1 and 0.
Here's an example of what a return value might look like:
[ { id => 123, changes => { name => { removed => 'FooName', added => 'BarName' }, default_assignee => { removed => 'foo@company.com', added => 'bar@company.com', } } } ]
One of the contact e-mail addresses is not a valid Bugzilla user.
The product you are trying to modify does not exist or you don't have access to it.
You do not have the permission to change components for this product.
The name specified for this component was longer than the maximum allowed length.
You specified the name of a component that already exists. (Component names must be unique per product in Bugzilla.)
You must specify a non-blank name for this component.
You must specify a description for this component.
You have attempted to set more than one component in the same product with the same name. Component names must be unique in each product.
A default assignee is required for this component.
$ids = BZ::Client::Component->delete( $client, \%params ); @ids = BZ::Client::Component->delete( $client, \%params );
This allows you to delete one or more components in Bugzilla.
You must set one or both of these parameters.
ids (array) Numeric ID's of the components that you wish to delete.
names (array of hashes). Names of the components that you wish to delete. The hash keys are product and component, representing the name of the product and the component you wish to delete.
An array of ID's that were deleted
You do not have the permission to delete components for this product.
The component you are trying to delete currently has bugs assigned to it. You must move these bugs before trying to delete the component.
See BZ::Client::Exception
BZ::Client, BZ::Client::API, Bugzilla API
Dean Hamstead <dean@bytefoundry.com.au>
Jochen Wiedmann <jochen.wiedmann@gmail.com>
This software is copyright (c) 2017 by Dean Hamstad.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install BZ::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BZ::Client
CPAN shell
perl -MCPAN -e shell install BZ::Client
For more information on module installation, please visit the detailed CPAN module installation guide.