5.7.233. Bugzilla::Extension::SubComponents::WebService

5.7.233.1. NAME

Bugzilla::Extension::SubComponents::WebService - The SubComponent API

5.7.233.2. DESCRIPTION

This part of the Bugzilla API allows you to get info about accessible subcomponents, create new subcomponents and also edit the attributes of existing subcomponents.

5.7.233.3. METHODS

See Bugzilla::WebService for a description of what STABLE, UNSTABLE, and EXPERIMENTAL mean, and for more information about error codes.

Get SubComponents

  • get EXPERIMENTAL
  • Description

Returns information about Bugzilla::SubComponent in accessible Bugzilla::Component.

You may retreive a list of all sub componets for a component using the Product.get method. Documentation is available in Bugzilla::WebService::Product

  • Params

At least one of the following two parameters must be specified:

  • ids (array) - An array of integers, representing subcomponents ids.
  • names (array) - An array of hashes, each hash has product, component and subcomponent name.
  • Returns

Information about all accessible product subcomponents passed. SubComponents that do not exist or are not accessible are silently ignored.

The return value will be a hash containing one item, subcomponents, that is an array of hashes. Each hash describes a subcomponent, and has the following items:

  • id
int The unique integer ID that Bugzilla uses to identify this subcomponent. Even if the name of the subcomponent changes, this ID will stay the same.
  • name
string The name of the subcomponent.
  • name_tree
array An array of strings containing the names of all the sub components above this sub component.
  • description
string The description of the subcomponent.
  • product_id
int The id of the product that the subcomponent belongs to.
  • product_name
string The name of the product that this component belongs to
  • component_id
int The id of the component that this subcomponent belongs to
  • component_name
string The name of the component that this subcomponent belongs to
  • default_assignee
string The login name of the default owner of the subcomponent if the user is logged in, if the user is not logged in then only the realname of the default owner will be returned.
  • default_qa_contact
string The login name of the default qa contact of the subcomponent if the user is logged in, if the user is not logged in then only the realname of the default qa contact will be returned.
  • default_docs_contact
string The login name of the default docs contact of the subcomponent if the user is logged in, if the user is not logged in then only the realname of the default docs contact will be returned.
  • default_cc
array The default CC list for this subcomponent. It is an array of login names if the user is logged in. If the user is not logged in then only the realnames of the default cc list members will be returned.
  • level
int How many levels deep is this subcomponent. 0 is a top level subcomponent.
  • sort_key
int The sort key of this subcomponent.
  • is_active
boolean True if the component is active. False if it is inactive.
  • parent_id
int optional The ID of the parent subcomponent. Will be absent if there is no parent.
  • agile_team
string The name of the Agile Team bugs in this subcomponent will default to.
  • Errors
  • 51 (Invalid Object)
A non existing product or subcomponent name was passed to the function, as a result no product or subcomponent object existed for that invalid name.
  • 106 (Invalid Product)
You were required to specify a product, and either you didn’t, or you specified an invalid product (or a product that you can’t access).

Create SubComponent

  • create EXPERIMENTAL
  • Description
Creates new subcomponent for an existing product.
  • Params

A hash containing the following subcomponent fields:

  • product
string Required The name of the product that the subcomponent will be added to.
  • component
string Required The name of the component this subcomponent will be a child of
  • subcomponent
string Required The name of the new sub component.
  • description
string Required The description of the new subcomponent.
  • default_assignee
string Required The initial owner of the new subcomponent.
  • default_qa_contact
string Optional The initial qa contact for the new subcomponent.
  • default_docs_contact
string Optional The initial docs contact for the new subcomponent.
  • default_cc
array Optional Array of the initial cclist for the new subcomponent.
  • parent_id
int Optional If this subcomponent has a parent subcomponent, this will contain its id.
  • sort_key
int Optional The sort key for this subcomponent.
  • is_active
boolean Optional True to create the subcomponent active. False to create the subcomponent inactive.
  • default_to_private
boolean True if bugs for this subcomponent default to private.
  • Returns
A hash containing one item, id, which is the id of the newly created subcomponent
  • Errors
  • 304 (Authorization Required) Logged-in user not authorized to create subcomponents.
  • 106 (Product Access Denied) Logged-in user doesn’t have access to the specified product to create

subcomponents for it.

  • 50 (Product Not Specified) Logged-in user didn’t specify any product names for the subcomponent they want

to create.

  • 106 (Product Doesn’t Exist) The specified product doesn’t exist.
  • 105 (Component Name Is Too Long) The name of the subcomponent is longer than 64 characters.
  • 105 (Component Requires Default Assignee) User didn’t specify a default assignee for the new subcomponent.
  • 105 (Blank Component Description Not Allowed) User didn’t specify a description for the new subcomponent.
  • 105 (Blank Component Name Not Allowed) User didn’t specifiy name for the new subcomponent.
  • 105 (Component Already Exists) Trying to create a subcomponent which has similar name to an existing subcomponent.
  • 51 (Invalid Username) Invalid login name was provided for the subcomponent’s default assignee,

default qa contact, default docs contact or one of the default cc.

Update SubComponents

  • update EXPERIMENTAL
  • Description
Updates single or multiple subcomponents information.
  • Params

A hash containing either ids, which is an array of integers of the sub component ids. Or names, which is an array of hashes. Each hash has a product name, component name and subcomponent name. And, updates which is a hash containing the subcomponent fields that will be updated. the update hash may contain any of the following items:

  • name
string The name of the subcomponent.
  • description
string The description of the subcomponent.
  • default_assignee
string The login name of the default owner of the subcomponent.
  • default_qa_contact
string The login name of the default qa contact of the subcomponent.
  • default_docs_contact
string The login name of the default docs contact of the subcomponent.
  • default_cc
array A list of the login names in the default cc list of the subcomponent.
  • parent_id
int optional The parent id of this subcomponent
  • sort_key
int Optional The sort key for this sub component.
  • is_active
boolean Optional True to enable the subcomponent, False to disable the subcomponent.
  • default_to_private
boolean True if bugs for this subcomponent default to private.
  • Returns

A hash containing one item, subcomponents_updates, which is a hash of hashes, with subcomponent ids as the hash keys pointing to hashes that contains the changes that were made to the subcomponent information. The hash may contain any of the following:

  • name
array An array of (strings) that holds the old and the new names of the subcomponent.
  • description
array An array of (strings) that holds the old and the new descriptions of the subcomponent.
  • default_assignee
array An Array of (strings) that holds the old and the new login names of the default owner of the subcomponent.
  • default_qa_contact
array An array of (strings) that holds the old and the new login names of the default qa contact of the subcomponent.
  • default_docs_contact
array An array of (strings) that holds the old and the new login names of the default docs contact of the subcomponent.
  • default_cc
array An array of (strings) that holds the old and the new lists of the login names in the default cc list of the subcomponent.
  • Errors
  • 50 (Invalid Product)
You were required to specify a product, and either you didn’t, or you specified an invalid product (or a product that you can’t access).
  • 304 (Authorization Required) Logged-in user not authorized to edit subcomponents.
  • 105 (Component Already Exists) Trying to change subcomponent name to similar name of an existing subcomponent

of the same product.

  • 51 (Invalid Username) Invalid login name was provided for the subcomponent’s default assignee,

default qa contact, default docs contact or one of the default cc.

  • 105 (Component Name Is Too Long) The name of the subcomponent is longer than 64 characters.
  • 105 (Multiple Components Update Not Allowed) Can not do multiple subcomponents update when changing the name

of multiple subcomponents of the same product.

Delete SubComponents

  • delete EXPERIMENTAL
  • Description
Deletes one or more subcomponents.
  • Params

A hash containing either ids, which is an array of integers of the sub component ids you wish to delete. Or names, which is an array of hashes. Each hash has a product name, component name and subcomponent name.

If any of the subcomponents has bugs belonging to that sub component, the entire delete operation will fail. That is to say, all subcomponents you wish to delete must have zero bugs.

  • Returns
A hash containing one item, deleted which contains an array of subcomponent ids that were deleted.
  • Errors
  • 50 (Invalid Product)
You were required to specify a product, and either you didn’t, or you specified an invalid product (or a product that you can’t access).
  • 304 (Authorization Required) Logged-in user not authorized to edit subcomponents.
  • 105 (Component Already Exists) Trying to change subcomponent name to similar name of an existing subcomponent

of the same product.

  • 105 (Sub Component Has Bugs) Attempting to delete a sub component that has bugs in it.

This documentation undoubtedly has bugs; if you find some, please file them here.