5.7.200. Bugzilla::Extension::RedHat::WebService::Component¶
5.7.200.1. NAME¶
Bugzilla::WebService::Component - The Component API
5.7.200.2. DESCRIPTION¶
This part of the Bugzilla API allows you to get info about accessible components, create new components and also edit the attributes of existing components.
5.7.200.3. METHODS¶
See Bugzilla::WebService for a description of what STABLE, UNSTABLE, and EXPERIMENTAL mean, and for more information about error codes.
Get Components¶
getEXPERIMENTAL
- Description
Returns information about Bugzilla::Component in accessible Bugzilla::Product.
- Params
At least one of the following two parameters must be specified:
ids(array) - An array of integers, representing components ids.names(array) - An array of hashes, each hash has product name and component name.
- Returns
Information about all accessible product components passed. Components that do not exist or are not accessible are silently ignored.
The return value will be A hash containing one item,
components, that is an array of hashes. Each hash describes a component, and has the following items:
- id
intThe unique integer ID that Bugzilla uses to identify this component. Even if the name of the component changes, this ID will stay the same.
- name
stringThe name of the component.
- description
stringThe description of the component.
- product_id
intThe id of the product that the component belongs to.
- product_name
stringThe name of the product that the component belongs to.
- default_assignee
stringThe login name of the default owner of the component 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
stringThe login name of the default qa contact of the component 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
stringThe login name of the default docs contact of the component 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
arrayThe default CC list for this component. It is an array of login names if the user is logged in. If the user is not logged in then only the realname of the default cc list members will be returned.
- flags
arrayList of component flags, only returned for logged in users.
- template_id
stringThe template text ID that is used when creating new bugs for this component.
- agile_team
stringthe Agile Team bugs in this component will default to.
is_active
booleanA boolean indicating if the component is active. Inactive components are not enabled for new bugs.This feature is a Red Hat customisation.
default_to_private
booleanA boolean indicating if bugs for the component default to private.This feature is a Red Hat customisation.
- Errors
- 51 (Invalid Object)
A non existing product or component name was passed to the function, as a result no product or component 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 Component¶
createEXPERIMENTAL
- Description
Creates new component for an existing product.
- Params
A hash containing the following component fields:
- product
stringRequired The name of the product that the component will be added to.
- component
stringRequired The name of the new component.
- description
stringRequired The description of the new component.
- default_assignee
stringRequired The initial owner of the new component.
- default_qa_contact
stringOptional The initial qa contact for the new component.
- default_docs_contact
stringOptional The initial docs contact for the new component.
- default_cc
arrayOptional Array of the initial cclist for the new component.
- template_id
stringOptional The ID of the default template to use when creating a bug with this component.
- Returns
A hash containing one item,id, which is the id of the newly created component
- Errors
- 304 (Authorization Required) Logged-in user not authorized to create components.
- 106 (Product Access Denied) Logged-in user doesn’t have access to the specified product to create
components for it.
- 50 (Product Not Specified) Logged-in user didn’t specify any product names for the component 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 component is longer than 64 characters.
- 105 (Component Requires Default Assignee) User didn’t specify a default assignee for the new component.
- 105 (Blank Component Description Not Allowed) User didn’t specify a description for the new component.
- 105 (Blank Component Name Not Allowed) User didn’t specifiy name for the new component.
- 105 (Component Already Exists) Trying to create a component which has similar name to an existing component.
- 51 (Invalid Username) Invalid login name was provided for the component’s default assignee,
default qa contact, default docs contact or one of the default cc.
Update Components¶
updateEXPERIMENTAL
- Description
Updates single or multiple components information.
- Params
A hash containing either
ids, that is an array of integers or a single integer representing the components ids, ornames, that is an array of hashes, each hash has product name and component name, or both together, andupdatesthat is a hash containg the component fields that will be updated, the update has may contain any of the following items:
- name
stringThe name of the component.
- description
stringThe description of the component.
- default_assignee
stringThe login name of the default owner of the component.
- default_qa_contact
stringThe login name of the default qa contact of the component.
- default_docs_contact
stringThe login name of the default docs contact of the component.
- default_cc
arrayA list of the login names in the default cc list of the component.
- template_id
stringOptional The ID of the default template to use when creating a bug with this component.
- Returns
A hash containing one item,
components_updates, which is a hash of hashes, with component ids as the hash keys pointing to hashes that contains the changes that were made to the component information. The hash may contain any of the following:
- name
arrayAn array of (strings) that holds the old and the new names of the component.
- description
arrayAn array of (strings) that holds the old and the new descriptions of the component.
- default_assignee
arrayAn Array of (strings) that holds the old and the new login names of the default owner of the component.
- default_qa_contact
arrayAn array of (strings) that holds the old and the new login names of the default qa contact of the component.
- default_docs_contact
arrayAn array of (strings) that holds the old and the new login names of the default docs contact of the component.
- default_cc
arrayAn array of (strings) that holds the old and the new lists of the login names in the default cc list of the component.
- 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 components.
- 105 (Component Already Exists) Trying to change component name to similar name of an existing component
of the same product.
- 51 (Invalid Username) Invalid login name was provided for the component’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 component is longer than 64 characters.
- 105 (Multiple Components Update Not Allowed) Can not do multiple components update when changing the name
of multiple components of the same product.
Delete Components¶
deleteEXPERIMENTAL
- Description
This allows you to delete one or more components in Bugzilla.
- Params
Note: The following parameters specify which components you are deleting. You must set one or both of these parameters.
idsarrayofints. Numeric ids of the components that you wish to delete.
namesarrayofhashes. Names of the components that you wish to delete. The hash keys areproductandcomponent, representing the name of the product and the component you wish to delete.
- Returns
A
hashwith a single field “components”. This points to an array of hashes with the following field:
idintThe id of the component that was deleted.
- Errors
- 106 (Product access denied)
The product you are trying to modify does not exist or you don’t have access to it.
- 706 (Product admin denied)
You do not have the permission to delete components for this product.
- 1202 (Component has bugs)
The component you are trying to delete currently has bugs assigned to it. You must move these bugs before trying to delete the component.
- History
- Added in Bugzilla 5.0
Backported to RHBZ 4.4.
This documentation undoubtedly has bugs; if you find some, please file them here.