<<

# Bugzilla::Webservice::Group

- NAME
- DESCRIPTION
- METHODS
- Group Creation and Modification
  - create
  - update

# NAME

Bugzilla::Webservice::Group - The API for creating, changing, and getting information about Groups.

# DESCRIPTION

This part of the Bugzilla API allows you to create Groups and get information about them.

# 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.

# 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.

  `name`

    Required `string` A short name for this group. Must be unique. This is not usually displayed in the user interface, except in a few places.

  `description`

    Required `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.

  `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`

    `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`

    `string` 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

  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 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.

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 `ids` param will be overridden as it is pulled from the URL path.

Params

  At least `ids` or `names` must be set, or an error will be thrown.

  `ids`

    Required `array` Contain ids of groups to update.

  `names`

    Required `array` Contain names of groups to update.

  `name`

    `string` A new name for group.

  `description`

    `string` A new description for groups. This is what will appear in the UI as the name of the groups.

  `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`

    `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`

    `string` A URL pointing to an icon that will appear next to the name of users who are in this group.

Returns

  A `hash` with a single field "groups". This points to an array of hashes with the following fields:

  `id`

    `int` The id of the group that was updated.

  `changes`

    `hash` 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`

      `string` The values that were added to this field, possibly a comma-and-space-separated list if multiple values were added.

    `removed`

      `string` The 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.

<<