BZ::Cl...Product(3pm)

πŸ“¦
version 4.9100 Β· 4 versions
, in epel 10

🌸 NAME 🌸

okay so bestie, this page is for BZ::Client::Product β€” the client side representation of a product in Bugzilla. The header says BZ::Cl...Product(3pm) and β€œUser Contributed Perl Documentation”, but we're folding that in right here instead of copy-pasting the line, periodt. πŸ’…


πŸ¦‹ VERSION πŸ¦‹

version 4.91 β€” that's the whole version vibe. ✨


✨ SYNOPSIS ✨

This class provides methods for accessing and managing products in Bugzilla. Instances of this class are returned by BZ::Client::Product::get.

my $client = BZ::Client->new( url       => $url,
                              user      => $user,
                              password  => $password );

my $ids = BZ::Client::Product->get_accessible_products( $client );
my $products = BZ::Client::Product->get( $client, \%params );

πŸ‘‘ CLASS METHODS πŸ‘‘

This section lists the class methods, which are available in this module.


πŸ’… create πŸ’…

$id = BZ::Client::Product->create( $client, \%params );

This allows you to create a new Product in Bugzilla. iconic behavior, honestly. 🫢

History

Marked as experimental as of Bugzilla 5.0. πŸ‘€

Parameters

Some params must be set, or an error will be thrown. These params are noted as Required.

  • name β€” name (string) The name of this product. Must be globally unique within Bugzilla. Required.
  • description β€” description (string) A description for this product. Allows some simple HTML. Required.
  • version β€” version (string) The default version for this product. Required.
  • has_unconfirmed β€” has_unconfirmed (boolean) Allow the UNCONFIRMED status to be set on bugs in this product. Default: true.
  • classification β€” classification (string) The name of the Classification which contains this product.
  • default_milestone β€” default_milestone (string) The default milestone for this product. Default '---'.
  • is_open β€” is_open (boolean) True if the product is currently allowing bugs to be entered into it. Default: true.
  • create_series β€” create_series (boolean) True if you want series for New Charts to be created for this new product. Default: true.

Returns

The ID of the newly-filed product. slay. ✨

Errors

  • 51 β€” Classification does not exist β€” You must specify an existing classification name.
  • 700 β€” Product blank name β€” You must specify a non-blank name for this product.
  • 701 β€” Product name too long β€” The name specified for this product was longer than the maximum allowed length.
  • 702 β€” Product name already exists β€” You specified the name of a product that already exists. (Product names must be globally unique in Bugzilla.)
  • 703 β€” Product must have description β€” You must specify a description for this product.
  • 704 β€” Product must have version β€” You must specify a version for this product.

πŸŽ€ update πŸŽ€

$id = BZ::Client::Product->update( $client, \%params );

This allows you to update a Group in Bugzilla. yes, Group β€” that's literally what the page says πŸ‘€.

History

As of Bugzilla 5.0, this is marked as experimental.

Added in Bugzilla 4.4.

Parameters

Either ids or names is required to select the bugs you want to update.

All other values change or set something in the product.

  • ids β€” ids (array) Numeric ID's of the products you wish to update.
  • names β€” names (array) Text names of the products that you wish to update.
  • default_milestone β€” default_milestone (string) When a new bug is filed, what milestone does it get by default if the user does not choose one? Must represent a milestone that is valid for this product.
  • description β€” description (string) Update the long description for these products to this value.
  • has_unconfirmed β€” has_unconfirmed (boolean) Allow the UNCONFIRMED status to be set on bugs in this products. (their words, not mine πŸ™ˆ)
  • is_open β€” is_open (boolean) True if the product is currently allowing bugs to be entered into it. Otherwise false.

Returns

An array or arrayref of hashes containing the following:

  • id β€” id (int) The ID of the product that was updated.
  • changes β€” The changes that were actually done on this product. The keys are the names of the fields that were changed, and the values are a hash with two keys:
    • added β€” added (string) The value that this field was changed to.
    • removed β€” 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'
            },
            has_unconfirmed => {
                removed => '1',
                added   => '0',
            }
        }
    },
    \%etc
],

Errors

  • 700 β€” Product blank name β€” You must specify a non-blank name for this product.
  • 701 β€” Product name too long β€” The name specified for this product was longer than the maximum allowed length.
  • 702 β€” Product name already exists β€” You specified the name of a product that already exists. (Product names must be globally unique in Bugzilla.)
  • 703 β€” Product must have description β€” You must specify a description for this product.
  • 705 β€” Product must define a default milestone β€” You must define a default milestone.

πŸ¦‹ get_selectable_products πŸ¦‹

@products = BZ::Client::Product->get_selectable_products( $client );
$products = BZ::Client::Product->get_selectable_products( $client );

Returns a list of the ID's of the products the user can search on.

History

Marked as experimental as of Bugzilla 5.0.

Parameters

(none)

Returns

An array of product ID's.

Errors

(none)


🌈 get_enterable_products 🌈

@products = BZ::Client::Product->get_enterable_products( $client );
$products = BZ::Client::Product->get_enterable_products( $client );

Returns a list of the ID's of the products the user can enter bugs against.

History

Marked as experimental as of Bugzilla 5.0.

Parameters

(none)

Returns

An array of product ID's.

Errors

(none)


⭐ get_accessible_products ⭐

@products = BZ::Client::Product->get_selectable_products( $client );
$products = BZ::Client::Product->get_selectable_products( $client );

Returns a list of the ID's of the products the user can search or enter bugs against.

History

Marked as unstable as of Bugzilla 5.0.

Parameters

(none)

Returns

An array of product ID's.

Errors

(none)


πŸ’– get πŸ’–

@products = BZ::Client::Product->get( $client, \%params );
$products = BZ::Client::Product->get( $client, \%params );

Returns a list of BZ::Client::Product instances based on the given parameters.

Note, that if the user tries to access a product that is not in the list of accessible products for the user, or a product that does not exist, that is silently ignored, and no information about that product is returned. silent treatment, but make it API. πŸ’€

Parameters

In addition to the parameters below, this method also accepts the standard include_fields in BZ::Client::Bug and exclude_fields in BZ::Client::Bug arguments.

Note: You must at least specify one of ids or names.

  • ids β€” ids (array) An array of product ID's.
  • names β€” names (array) An array of product names. Added in Bugzilla 4.2.
  • type β€” The group of products to return. Valid values are: accessible (default), selectable, and enterable. type can be a single value or an array of values if more than one group is needed with duplicates removed.

Returns

An array or arrayref of bug instance objects with the given ID's.

See INSTANCE METHODS for how to use them.

Errors

(none)


🧚 get_products 🧚

Compatibility with Bugzilla 3.0 API. Exactly equivalent to get.


🌸 new 🌸

my $product = BZ::Client::Product->new( id           => $id,
                                        name         => $name,
                                        description  => $description );

Creates a new instance with the given ID, name, and description.

✨ INSTANCE METHODS ✨

okay bestie this is the section where the actual doing stuff happens πŸ’… these are all the methods you call on a product object. buckle up πŸŽ€


πŸͺͺ id

$id = $product->id();

gets the product's ID. that's it, that's the whole thing.

read only β€” you can look, you cannot touch πŸ”’

🌸 name

$name = $product->name();
$product->name( $name );

gets or sets the product's name. classic getter/setter energy ✨

πŸ“ description

$description = $product->description();
$product->description( $description );

gets or sets the product's description. go off, describe yourself πŸ’–

πŸ”’ version

$version = $product->version();
$product->version( $version );

gets or sets the product's version.

heads up queen: set only works for new products, not updates ⚠️ like, once it exists, that version is locked in. no take-backsies.

❓ has_unconfirmed

$bool = $product->has_unconfirmed();
$product->has_unconfirmed( $bool );

gets or sets the product's has_unconfirmed setting.

added in Bugzilla 4.2 as a replacement for "internals" 🫢

πŸ—‚οΈ classification

$classification = $product->classification();
$product->classification( $classification );

gets or sets the product's classification.

added in Bugzilla 4.2 as a replacement for "internals" 🫢

🎯 default_milestone

$milestone = $product->default_milestone();
$product->default_milestone( $milestone );

gets or sets the product's default milestone.

added in Bugzilla 4.2 as a replacement for "internals" 🫢

🟒 is_open

$bool = $product->is_open();
$product->is_open( $bool );

gets or sets the product's is_open setting. open for business or closed for vibes πŸ’€

πŸ“ˆ create_series

$series = $product->create_series();
$product->create_series( $series );

gets or sets the product's is_open setting.

not me pointing out that the docs say is_open here πŸ™ˆ that's literally what it says though, so I'm passing it to you word for word β€” iykyk.

🧩 components

@components = $product->components();
$components = $product->components();

an array of hashes, where each hash describes a component πŸ‘‘ and each hash has these items:

  • id β€” id (int) an integer ID uniquely identifying the component in this installation only.
  • name β€” name (string) the name of the component. this is a unique identifier for this component.
  • description β€” description (string) a description of the component, which may contain HTML.
  • default_assigned_to β€” default_assigned_to (string) the login name of the user to whom new bugs will be assigned by default.
  • default_qa_contact β€” default_qa_contact (string) the login name of the user who will be set as the QA Contact for new bugs by default. empty string if the QA contact is not defined.
  • sort_key β€” sort_key (int) components, when displayed in a list, are sorted first by this integer and then secondly by their name.
  • is_active β€” is_active (boolean) a boolean indicating if the component is active. inactive components are not enabled for new bugs.
  • flag_types β€” added in Bugzilla 4.4 ✨ a hash containing the two items bug and attachment that each contains an array of hashes, where each hash describes a flagtype, and has the following items:
    • id β€” id (int) returns the ID of the flagtype.
    • name β€” name (string) returns the name of the flagtype.
    • description β€” description (string) returns the description of the flagtype.
    • cc_list β€” cc_list (string) returns the concatenated CC list for the flagtype, as a single string.
    • sort_key β€” sort_key (int) returns the sortkey of the flagtype.
    • is_active β€” is_active (boolean) returns whether the flagtype is active or disabled. flags being in a disabled flagtype are not deleted. it only prevents you from adding new flags to it.
    • is_requestable β€” is_requestable (boolean) returns whether you can request for the given flagtype (i.e. whether the '?' flag is available or not).
    • is_requesteeble β€” is_requesteeble (boolean) returns whether you can ask someone specifically or not.
    • is_multiplicable β€” is_multiplicable (boolean) returns whether you can have more than one flag for the given flagtype in a given bug/attachment.
    • grant_group β€” grant_group (int) the group ID that is allowed to grant/deny flags of this type. if the item is not included all users are allowed to grant/deny this flagtype.
    • request_group β€” request_group (int) the group ID that is allowed to request the flag if the flag is of the type requestable. if the item is not included all users are allowed request this flagtype.

added in Bugzilla 4.2 as a replacement for "internals" 🫢

🏷️ versions

$versions = $product->versions();

added in Bugzilla 4.2 as a replacement for "internals" 🫢

returns an array of hashes, where each hash describes a version, and has the following items: "name", "sort_key" and "is_active". slay πŸ¦‹

🚩 milestones

$milestones = $product->milestones();

returns an array of hashes, where each hash describes a milestones, and has the following items: "name", "sort_key" and "is_active".

added in Bugzilla 4.2 as a replacement for "internals" 🫢

πŸ’€ internals

returned by "get" until version 4.2, at which point it was dropped. remains for compatibility.

please move away from using it asap πŸ™ like fr fr, it's giving deprecated. it's giving "we keep it around so your old code doesn't cry" 😭

🚨 EXCEPTION HANDLING 🚨

see BZ::Client::Exception β€” that's where the drama lives when things go wrong πŸ’…

πŸ‘€ SEE ALSO πŸ‘€

πŸ‘‘ AUTHORS πŸ‘‘

  • Dean Hamstead <dean@bytefoundry.com.au>
  • Jochen Wiedmann <jochen.wiedmann@gmail.com>

this software is copyright (c) 2026 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. 🫢


and that's the whole page bestie, you ate that 🌈 this was perl v5.40.2, dated 2026-07-16, straight from the BZ::Cl...Product(3pm) files β€” go build something iconic with it βœ¨πŸ’–πŸŽ€

πŸ“¦ where this page comes from