NAME
BZ::Client::Group - The API for creating, changing, and getting info on Groups
VERSION
version 2.0_9
SYNOPSIS
This class provides methods for accessing and managing Groups in Bugzilla.
my $client = BZ::Client->new( url => $url,
user => $user,
password => $password );
my $id = BZ::Client::Group->create( $client, \%params );
CLASS METHODS
This section lists the class methods, which are available in this module.
create
$id = BZ::Client::Group->create( $client, \%params );
This allows you to create a new Group in Bugzilla.
Marked as unstable 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) A short name for this group. Must be unique.
This is infrequently displayed in the web user interface.
Required.
- description
-
description (string) A human-readable name for this group. Should be relatively short.
This is what will normally appear in the UI as the name of the group.
Required.
- user_regexp
-
user_regexp (string) A regular expression. Any user whose Bugzilla username matches this regular expression will automatically be granted membership in this group.
- is_active
-
is_active (boolean) True if new group can be used for bugs,
False if this is a group that will only contain users and no bugs will be restricted to it.
- icon_url
-
icon_url (boolean) A URL pointing to a small icon used to identify the group. This icon will show up next to users' names in various parts of Bugzilla if they are in this group.
Returns
The ID of the newly-created group.
Errors
- 800 - Empty Group Name
-
You must specify a value for the "name" field.
- 801 - Group Exists
-
There is already another group with the same "name".
- 802 - Group Missing Description
-
You must specify a value for the "description" field.
- 803 - Group Regexp Invalid
-
You specified an invalid regular expression in the "user_regexp" field.
update
$id = BZ::Client::Group->update( $client, \%params );
This allows you to update a Group in Bugzilla.
As of Bugzilla 5.0. this is marked as unstable.
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 ids of the groups you wish to update.
- names
-
names (array) Text names of the groups that you wish to update.
- name
-
name (string) A new name for group.
- description
-
description (string) A new description for groups. This is what will appear in the UI as the name of the groups.
- user_regexp
-
user_regexp (string) A new regular expression for email. Will automatically grant membership to these groups to anyone with an email address that matches this perl regular expression.
- is_active
-
is_active (boolean) Set if groups are active and eligible to be used for bugs. True if bugs can be restricted to this group, false otherwise.
- icon_url
-
icon_url (string) A URL pointing to an icon that will appear next to the name of users who are in this group.
Returns
An array or arrayref of hashes containing the following:
- id
-
id (int) The id of the Group that was updated.
- changes
-
The changes that were actually done on this Group. The keys are the names of the fields that were changed, and the values are a hash with two keys:
- added
-
added (string) The values that were added to this field, possibly a comma-and-space-separated list if multiple values were added.
- removed
-
removed (string) The values that were removed from this field, possibly a comma-and-space-separated list if multiple values were removed.
Note that booleans will be represented with the strings '1' and '0'.
Errors
- 800 - Empty Group Name
-
You must specify a value for the "name" field.
- 801 - Group Exists
-
There is already another group with the same "name".
- 802 - Group Missing Description
-
You must specify a value for the "description" field.
- 803 - Group Regexp Invalid
-
You specified an invalid regular expression in the "user_regexp" field.
get
Implemented but documentation is TODO
INSTANCE METHODS
Not yet implemented
SEE ALSO
BZ::Client, BZ::Client::API, Bugzilla API
AUTHORS
Dean Hamstead <dean@bytefoundry.com.au>
Jochen Wiedmann <jochen.wiedmann@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 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.