5.7.92. Bugzilla::WebService::Group¶
5.7.92.1. NAME¶
Bugzilla::Webservice::Group - The API for creating, changing, and getting information about Groups.
5.7.92.2. DESCRIPTION¶
This part of the Bugzilla API allows you to create Groups and get information about them.
5.7.92.3. METHODS¶
See Bugzilla::WebService for a description of how parameters are passed, and what STABLE, UNSTABLE, and EXPERIMENTAL mean.
Although the data input and output is the same for JSONRPC, XMLRPC and REST, the directions for how to access the data via REST is noted in each method where applicable.
5.7.92.4. Group Creation and Modification¶
create¶
UNSTABLE
Description
This allows you to create a new group in Bugzilla.
REST
POST /rest/group
The params to include in the POST body as well as the returned data format, are the same as below.
Params
Some params must be set, or an error will be thrown. These params are marked Required.
nameRequiredstringA short name for this group. Must be unique. This is not usually displayed in the user interface, except in a few places.
descriptionRequiredstringA 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.
user_regexpstringA regular expression. Any user whose Bugzilla username matches this regular expression will automatically be granted membership in this group.
is_activebooleanTrueif new group can be used for bugs,Falseif this is a group that will only contain users and no bugs will be restricted to it.
icon_urlstringA 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
A hash with one element,id. This is the id of the newly-created group.
Errors
800 (Empty Group Name)
You must specify a value for thenamefield.801 (Group Exists)
There is already another group with the samename.802 (Group Missing Description)
You must specify a value for thedescriptionfield.803 (Group Regexp Invalid)
You specified an invalid regular expression in theuser_regexpfield.
History
REST API call added in Bugzilla 5.0.
update¶
UNSTABLE
Description
This allows you to update a group in Bugzilla.
REST
PUT /rest/group/<group_name_or_id>
The params to include in the PUT body as well as the returned data format, are the same as below. The
idsparam will be overridden as it is pulled from the URL path.
Params
At least
idsornamesmust be set, or an error will be thrown.
idsRequiredarrayContain ids of groups to update.
namesRequiredarrayContain names of groups to update.
namestringA new name for group.
descriptionstringA new description for groups. This is what will appear in the UI as the name of the groups.
user_regexpstringA 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_activebooleanSet if groups are active and eligible to be used for bugs. True if bugs can be restricted to this group, false otherwise.
icon_urlstringA URL pointing to an icon that will appear next to the name of users who are in this group.
Returns
A
hashwith a single field "groups". This points to an array of hashes with the following fields:
idintThe id of the group that was updated.
changes
hashThe 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:
addedstringThe values that were added to this field, possibly a comma-and-space-separated list if multiple values were added.
removedstringThe values that were removed from this field, possibly a comma-and-space-separated list if multiple values were removed.
Errors
The same as create.
History
REST API call added in Bugzilla 5.0.
5.7.92.5. Group Information¶
get¶
UNSTABLE
Description
Returns information about Bugzilla::Group|Groups.
REST
To return information about a specific group by
idorname:GET /rest/group/<group_id_or_name>
You can also return information about more than one specific group by using the following in your query string:
GET /rest/group?ids=1&ids=2&ids=3 or GET /group?names=ProductOne&names=Product2
the returned data format is same as below.
Params
If neither ids or names is passed, and you are in the creategroups or editusers group, then all groups will be retrieved. Otherwise, only groups that you have bless privileges for will be returned.
idsarrayContain ids of groups to update.
namesarrayContain names of groups to update.
membershipbooleanSet to 1 then a list of members of the passed groups' names and ids will be returned.
Returns
If the user is a member of the "creategroups" group they will receive information about all groups or groups matching the criteria that they passed. You have to be in the creategroups group unless you're requesting membership information.
If the user is not a member of the "creategroups" group, but they are in the "editusers" group or have bless privileges to the groups they require membership information for, the is_active, is_bug_group and user_regexp values are not supplied.
The return value will be a hash containing group names as the keys, each group name will point to a hash that describes the group and has the following items:
id
intThe unique integer ID that Bugzilla uses to identify this group. Even if the name of the group changes, this ID will stay the same.name
stringThe name of the group.description
stringThe description of the group.is_bug_group
intWhether this groups is to be used for bug reports or is only administrative specific.user_regexp
stringA regular expression that allows users to be added to this group if their login matches.is_active
intWhether this group is currently active or not.users
arrayAn array of hashes, each hash contains a user object for one of the members of this group, only returned if the user sets themembershipparameter to 1, the user hash has the following items:id
intThe id of the user.real_name
stringThe actual name of the user.stringThe email address of the user.name
stringThe login name of the user. Note that in some situations this is different than their email.can_login
booleanA boolean value to indicate if the user can login into bugzilla.email_enabled
booleanA boolean value to indicate if bug-related mail will be sent to the user or not.disabled_text
stringA text field that holds the reason for disabling a user from logging into bugzilla, if empty then the user account is enabled otherwise it is disabled/closed.
Errors
51 (Invalid Object)
A non existing group name was passed to the function, as a result no group object existed for that invalid name.805 (Cannot view groups)
Logged-in users are not authorized to edit bugzilla groups as they are not members of the creategroups group in bugzilla, or they are not authorized to access group member's information as they are not members of the "editusers" group or can bless the group.
History
This function was added in Bugzilla 5.0.
This documentation undoubtedly has bugs; if you find some, please file them here.