5.7.173. Bugzilla::Extension::ExternalBugs::WebService¶
5.7.173.1. NAME¶
Bugzilla::Extension::ExternalBugs::WebService - The API for creating, changing, and deleting external bug trackers.
5.7.173.2. DESCRIPTION¶
This part of the Bugzilla API allows you to create, change and delete external bug tracking information for existing bugs in Red Hat Bugzilla. This is a Red Hat specific extension.
5.7.173.3. METHODS¶
See Bugzilla::WebService for a description of how parameters are passed, and what STABLE, UNSTABLE, and EXPERIMENTAL mean.
5.7.173.4. Functions¶
All functions require that you are logged in.
5.7.173.5. Webservice Group¶
All functions belong to the ExternalBugs group, for example: ExternalBugs.add_external_bug
get_ext_data¶
UNSTABLE
- Description
Get the current data for an external tracker, inlcuding attempting to sync data.
Note: This method will not send bug mail.
- Params
idintThe id of the external tracker bug.
- Returns
A
hashwith the following fields:
- id:
intThe id of the bug that was updated.- ext_bz_id:
intThe id of the external tracker.- ext_bz_bug_id:
intThe bug id of the external tracker bug (i.e. the bug number of the external tracker)- ext_status:
stringThe status of the external bug- ext_priority:
stringThe priority of the external bug- ext_description:
stringThe description of the external bug- ext_last_updated:
stringThe date the External Bug was last synced.- is_private:
boolThe link is private.- is_partner:
boolA private link is visible to one or more partner groups.- is_migration_link:
boolThis link is where a bug has been migrated to.
add_external_bug¶
UNSTABLE
- Description
Add one or more external tracker bugs to one or more existing bugs.
- Params
bug_idsarray- An array of bug ids.
external_bugs
array- An array ofstructs representing the external trackers you wish to add. Each hash has the following keys. either one ofext_bz_bug_idorext_bz_bug_urlmust be supplied.If
ext_bz_bug_urlis given, no other parameters are required.If
ext_bz_bug_idis given, at least one of ext_type_id, ext_type_description or ext_type_url must also be specified.
ext_bz_bug_urlstringThe full URL to the external bug to be linked to
ext_type_idintThe internal id of the external bugzilla type
ext_type_descriptionstringThe description the external bugzilla type
ext_type_urlstringThe URL value the external bugzilla type
ext_bz_bug_idstringThe external bug id (i.e. the bug number of the external tracker)
ext_statusstringThe status of the external bug
ext_descriptionstringThe description of the external bug
ext_prioritystringThe priority of the external bug
is_privateboolForce the link to be public or private. Leave unset to allow Bugzilla to automatically set this.
is_migration_linkboolThis link is where a bug has been migrated to.
minor_updatebooleanIf set to true, this is considered a minor update and no mail is sent to users who do not want minor update emails. If current user is not in the minor_update_group, this parameter is simply ignored.
- Returns
A
hashwith a single field, “bugs”. This points to anarrayofstructs with the following fields:
idintThe id of the bug that was updated.
aliasstringThe alias of the bug that was updated, if aliases are enabled and this bug has an alias.
last_change_timedateTimeThe exact time that this update was done at, for this bug. If no update was done (that is, no fields had their values changed and no comment was added) then this will instead be the last time the bug was updated.
changes
hashThe changes that were actually done on this bug. 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 wereremoved.
- Errors
- 50 (Parameter required)
You did not specify a required option
- 1001 (Invalid field)
You specified a field in the external_bugs array that is not valid.
- 1002 (External Tracker type not specified)
You must specify at least one of ext_type_id, ext_type_description or ext_type_url.
- 1003 (External Tracker type not found)
The combination of ext_type_* fields did not match any External Trackers. Either the tracker does not exist or you do not have permission to use it.
- 1004 (External Tracker type not unique)
The combination of ext_type_* fields matched more than one External Tracker.
update_external_bug¶
UNSTABLE
- Description
Changes one or more external tracker bugs.
Note: This method will not send bug mail.
- Params
At least one of ext_desciption, ext_priority or ext_status must be specified. Additionally, either ids, or one ext_type_* and ext_bz_bug_id must be specified. If the ‘ids’ key is specified, all other values are ignored for determining which external tracker bugs are updated.
idsarrayAn array of integer external tracker bug ids.
ext_type_idintThe internal id of the external bugzilla type
ext_type_descriptionstringThe description the external bugzilla type
ext_type_urlstringThe URL value the external bugzilla type
ext_bz_bug_idstingorarrayofstrings The external bug id (i.e. the bug number of the external tracker)
bug_idsarray- An array of bug ids.
ext_statusstringThe new status of the external bug
ext_descriptionstringThe new description of the external bug
ext_prioritystringThe new priority of the external bug
is_privateboolForce the link to be public or private. Leave unset to allow Bugzilla to automatically set this.
is_migration_linkboolThis link is where a bug has been migrated to.
- Returns
A
hashwith a single field, “external_bugs”. This points to anarrayofstructs with the following fields:
idintThe id of the external tracker bug that was updated.
bug_idintThe Red Hat Bugzilla bug number this external tracker bug is attached to.
ext_bz_idintThe id of the external tracker updated. More information is available in the type field.
ext_bz_bug_idintThe bug id of the external tracker bug (i.e. the bug number of the external tracker)
ext_statusstringThe status of the external bug
ext_descriptionstringThe description of the external bug
ext_prioritystringThe priority of the external bug
is_migration_linkboolThis link is where a bug has been migrated to.
typestructContains information about the External Tracker type.
- Errors
- 50 (Parameter required)
You did not specify a required option
- 1002 (External Tracker type not specified)
You must specify at least one of ext_type_id, ext_type_description or ext_type_url.
- 1003 (External Tracker type not found)
The combination of ext_type_* fields did not match any External Trackers. Either the tracker does not exist or you do not have permission to use it.
- 1004 (External Tracker type not unique)
The combination of ext_type_* fields matched more than one External Tracker.
- 1006 (No External Tracker bugs found)
No external tracker bugs were found that matched your criteria
- History
- Added in Bugzilla 4.2.1-2, as a Red Hat extension.
remove_external_bug¶
UNSTABLE
- Description
Removes one or more external tracker bugs.
- Params
Either ids, or one ext_type_* and ext_bz_bug_id must be specified. If the ‘ids’ key is specified, all other values are ignored.
idsarrayAn array of integer external tracker bug ids.
ext_type_idintThe internal id of the external bugzilla type
ext_type_descriptionstringThe description the external bugzilla type
ext_type_urlstringThe URL value the external bugzilla type
ext_bz_bug_idstingorarrayofstrings The external bug id (i.e. the bug number of the external tracker)
bug_idsarray- An array of bug ids.
minor_updatebooleanIf set to true, this is considered a minor update and no mail is sent to users who do not want minor update emails. If current user is not in the minor_update_group, this parameter is simply ignored.
- Returns
A
hashwith a single field, “external_bugs”. This points to anarrayofstructs representing the external tracker bugs deleted with the following fields:
idintThe id of the external tracker bug that was updated.
bug_idintThe Red Hat Bugzilla bug number this external tracker bug is attached to.
ext_bz_idintThe id of the external tracker updated. More information is available in the type field.
ext_bz_bug_idintThe bug id of the external tracker bug (i.e. the bug number of the external tracker)
ext_statusstringThe status of the external bug
ext_descriptionstringThe description of the external bug
ext_prioritystringThe priority of the external bug
is_migration_linkboolThis link is where a bug has been migrated to.
typestructContains information about the External Tracker type.
- Errors
- 50 (Parameter required)
You did not specify a required option
- 1002 (External Tracker type not specified)
You must specify at least one of ext_type_id, ext_type_description or ext_type_url.
- 1003 (External Tracker type not found)
The combination of ext_type_* fields did not match any External Trackers. Either the tracker does not exist or you do not have permission to use it.
- 1004 (External Tracker type not unique)
The combination of ext_type_* fields matched more than one External Tracker.
- 1006 (No External Tracker bugs found)
No external tracker bugs were found that matched your criteria
- History
- Added in Bugzilla 4.2.1-2, as a Red Hat extension.
get_tracker¶
UNSTABLE
- Description
Get one or more external trackers.
- Params
Either trackers, or all must be specified.
If a tracker is protected by group membership then it will not be visible if you are not a member of any of the groups.
trackersarrayAn array of tracker ids or descriptions.
allbooleanGet all trackers.
create_tracker¶
UNSTABLE
- Description
Create an external tracker.
You must be in the editcomments group to use this method.
- Params
description|trackerstringThe description to use for the tracker.
can_getOptionalbooleanShould Bugzilla try and sync data from this tracker?
regexOptional
stringThe type of data this field contains.If this is not set then IDs are not validated.
Number | ^[1-9]\d*$ | a number Mantis Numbers | ^\d+$ | a number with possible leading zeros JIRA Issue | ^[A-Z\d]+\-\d+$ | upper case letters or digits, a dash, and numbers Number or Alias | ^(:?[1-9]\d*|[0-9A-Za-z])$ | a number or alias SFDC Case | ^\d{8}$ | eight digits with possible leading zeros
formatOptional
stringA printf style sting for formatting an ID in the UI.See matchrx below.
e.g. Github: ‘%s %s %s %s’
full_url
stringThe full URL to a tracker.e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=%id%
matchrxOptional
stringA regex used to split up the ID for use in formatting.See format above.
e.g. Github: (.*)/(.*)/(issues|pull)/(.*)
typeOptional
integerThe type of tracker that it is. Used for syncing data.Supported types:
None Bugzilla Gerrit GitHub JIRA KBase Redmine SFDC SFDC_DEV SFDC_QA SFDC_Sandbox SFDC_StageType ‘None’ does not support syncing.
url
stringThe root URL for the site.
groupsOptionalarrayof group names to limit access to.
always_privateOptionalboolForce all links on this tracker to be treated as private. This will hide the tracker in the UI and API from users not in the specified groups.
must_getOptionalboolForce all links created on this tracker to be synced from the source. Failure to sync will block creation of links.
edit_tracker¶
UNSTABLE
- Description
Edit an external tracker.
You must be in the editcomments group to use this method.
- Params
trackerinteger|stringThe ID or description of the tracker.
can_getOptionalbooleanShould Bugzilla try and sync data from this tracker?
regexOptional
stringThe type of data this field contains.If this is not set then IDs are not validated.
Number | ^[1-9]\d*$ | a number Mantis Numbers | ^\d+$ | a number with possible leading zeros JIRA Issue | ^[A-Z\d]+\-\d+$ | upper case letters or digits, a dash, and numbers Number or Alias | ^(:?[1-9]\d*|[0-9A-Za-z])$ | a number or alias SFDC Case | ^\d{8}$ | eight digits with possible leading zeros
formatOptional
stringA printf style sting for formatting an ID in the UI.See matchrx below.
e.g. Github: ‘%s %s %s %s’
full_url
stringThe full URL to a tracker.e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=%id%
matchrxOptional
stringA regex used to split up the ID for use in formatting.See format above.
e.g. Github: (.*)/(.*)/(issues|pull)/(.*)
type
integerThe type of tracker that it is. Used for syncing data.Supported types:
None Bugzilla Gerrit GitHub GitLab JIRA KBase Redmine SFDC SFDC_DEV SFDC_QA SFDC_Sandbox SFDC_StageType ‘None’ does not support syncing.
url
stringThe root URL for the site.
groupsarrayof group names to limit access to.
always_privateOptionalboolForce all links on this tracker to be treated as private. This will hide the tracker in the UI and API from users not in the specified groups.
must_getOptionalboolForce all links created on this tracker to be synced from the source. Failure to sync will block creation of links.
This documentation undoubtedly has bugs; if you find some, please file them here.