Bugzilla:BzAPI:Search: Difference between revisions
Line 61: | Line 61: | ||
==Boolean Charts== | ==Boolean Charts== | ||
The Bugzilla "boolean charts" mechanism is the way to construct more complex queries, or to search on other fields which do not have their own dedicated parameters (e.g. time tracking fields, attachment fields, flags, groups and related bugs). See Bugzilla's documentation for details of how they work. At the moment, boolean chart parameters are passed through unchanged, apart from translating any [[Bugzilla:REST_API:Objects|new field names]] and new type names into the ones Bugzilla understands natively. | The Bugzilla "boolean charts" mechanism is the way to construct more complex queries, or to search on other fields which do not have their own dedicated parameters (e.g. time tracking fields, attachment fields, flags, history, groups and related bugs). See Bugzilla's documentation for details of how they work. At the moment, boolean chart parameters are passed through unchanged, apart from translating any [[Bugzilla:REST_API:Objects|new field names]] and new type names into the ones Bugzilla understands natively. | ||
The parameters for each triple are '''fieldA-B-C''', '''typeA-B-C''' and '''valueA-B-C''', where A, B and C are integers beginning at 0. | The parameters for each triple are '''fieldA-B-C''', '''typeA-B-C''' and '''valueA-B-C''', where A, B and C are integers beginning at 0. | ||
Line 79: | Line 79: | ||
Additional field values you can use are: | Additional field values you can use are: | ||
{| | {| border="1" | ||
! | !Name!!Description | ||
|- | |- | ||
|comment.is_private||Comment privacy | |comment.is_private||Comment privacy | ||
|- | |- | ||
|comment.author||Person adding a comment | |comment.author||Person adding a comment | ||
|- | |||
|content||Full text of bug; use with special 'matches' type | |||
|- | |- | ||
|idle||Time since bug was last changed by anyone, in days | |idle||Time since bug was last changed by anyone, in days | ||
Line 95: | Line 97: | ||
|- | |- | ||
|assignee_idle||Time since bug was last changed by assignee; postfix number with h/d/w/m/y to specify units | |assignee_idle||Time since bug was last changed by assignee; postfix number with h/d/w/m/y to specify units | ||
|} | |||
Type values you can use are: | |||
{| border="1" | |||
!Name!!Description!!Value Format Notes | |||
|- | |||
|equals||is equal to|| | |||
|- | |||
|not_equals||is not equal to|| | |||
|- | |||
|equals_any||is equal to any of the strings|| | |||
|- | |||
|contains||contains the string|| | |||
|- | |||
|not_contains||does not contain the string|| | |||
|- | |||
|case_contains||contains the string (exact case)|| | |||
|- | |||
|contains_any||contains any of the strings|| | |||
|- | |||
|not_contains_any||contains none of the strings|| | |||
|- | |||
|contains_all||contains all of the strings|| | |||
|- | |||
|contains_any_words||contains any of the words|| | |||
|- | |||
|not_contains_any_words||contains none of the words|| | |||
|- | |||
|contains_all_words||contains all of the words|| | |||
|- | |||
|regex||matches regular expression||(As interpreted by DB) | |||
|- | |||
|not_regex||does not match regular expression||(As interpreted by DB) | |||
|- | |||
|less_than||is less than||Integer or Timestamp | |||
|- | |||
|greater_than||is greater than||Integer or Timestamp | |||
|- | |||
|changed_before||changed before||Timestamp | |||
|- | |||
|changed_after||changed after||Timestamp | |||
|- | |||
|changed_from||changed from|| | |||
|- | |||
|changed_to||changed to|| | |||
|- | |||
|changed_by||changed by||name of User | |||
|- | |||
|matches||matches||Full text of bug contains the string; use only with special 'content' field | |||
|} | |} |
Revision as of 09:28, 2 October 2009
This page defines the URL parameter interface for searching for bugs using the HTTP API (/bug GET).
Single Value, Multiplicable
Specify any number of individual discrete values as separate URL parameters with identical keys.
Fields: classification, component, op_sys, platform, priority, product, resolution, severity, status, target_milestone, version
E.g. component=XML&severity=critical&severity=blocker
Text Fields
Specify some text to search for in the following fields along with a $FIELDNAME_type parameter holding one of the given values, to define the type of search.
Fields: comment, summary, url, whiteboard
Types: allwordssubstr, anywordssubstr, substring, casesubstring, allwords, anywords, regexp, notregexp
E.g. summary=Flash%20crash&summary_type=allwords
Person Fields
Specify up to two strings, as email1 and email2, and then specify the fields in which to search for those strings (booleans - set to 1 if wanted), and the type of search to do (emailN_type).
Fields: email1, email2, emailN_type, emailN_assigned_to, emailN_qa_contact, emailN_reporter, emailN_cc, emailN_comment_author
Types: substring, exact, notequals, regexp, notregexp
E.g. email1=fred@example.com&email1_type=exact&email1_assigned_to=1&email1_qa_contact=1
Other Fields
Bug ID
id=<comma-separated list>, id_type either include or exclude. Note that this field does not support aliases.
E.g. id=3,4,5,6&id_type=include
Deadline
Specify a range with deadline_from and deadline_to.
E.g. deadline_from=2008-08-08&deadline_to=2009-09-09
Keywords
Specify one or more keywords, comma-separated, and then a type of search as keywords_type:
Type: allwords anywords nowords
E.g. keywords=charming,interesting&keywords_type=anywords
Changes
You can also ask for bugs that have changed in a particular date range, using changed_from and/or changed_to. You may additionally specify that a particular field has changed in that time using changed_field, and also optionally set changed_field_to_value to specify the new value.
There is a magic value for "changed_field" of "[Bug Creation]" which allows you to look for bugs filed between certain dates. XXXchange to creation_time
E.g. changed_from=2008-08-08&changed_to=2009-09-09&changed_field=priority&changed_field_to_value=P1
Boolean Charts
The Bugzilla "boolean charts" mechanism is the way to construct more complex queries, or to search on other fields which do not have their own dedicated parameters (e.g. time tracking fields, attachment fields, flags, history, groups and related bugs). See Bugzilla's documentation for details of how they work. At the moment, boolean chart parameters are passed through unchanged, apart from translating any new field names and new type names into the ones Bugzilla understands natively.
The parameters for each triple are fieldA-B-C, typeA-B-C and valueA-B-C, where A, B and C are integers beginning at 0.
- A is the number of the chart; each chart is an entirely separate condition on the search.
- Within an A grouping, all charts with the same B are ANDed together.
- Within a B grouping, all charts with the same C are ORed together.
Or, to put it another way, with an example:
0-0-0 && 1-0-0 && (2-0-0 && 2-1-0) && (3-0-0 && (3-1-0 || 3-1-1 || 3-1-2))
Every field on the bug object (except ref, token and work_time, which is Submit Only) can be used with the boolean charts. You may search all attachment fields (except encoding) by specifying a field of "attachment.<fieldname>".
A Note on Plurality: some fields on the Bug object whose values are arrays are linguistically plural but search only applies to a single instance. The field names for search in these cases are in the singular. This applies to: comments, attachments, flags, and groups.
Additional field values you can use are:
Name | Description |
---|---|
comment.is_private | Comment privacy |
comment.author | Person adding a comment |
content | Full text of bug; use with special 'matches' type |
idle | Time since bug was last changed by anyone, in days |
flag | Name of a flag |
flag.requestee | Person of whom a flag set is requested (name) |
flag.setter | Person who set a flag (name) |
assignee_idle | Time since bug was last changed by assignee; postfix number with h/d/w/m/y to specify units |
Type values you can use are:
Name | Description | Value Format Notes |
---|---|---|
equals | is equal to | |
not_equals | is not equal to | |
equals_any | is equal to any of the strings | |
contains | contains the string | |
not_contains | does not contain the string | |
case_contains | contains the string (exact case) | |
contains_any | contains any of the strings | |
not_contains_any | contains none of the strings | |
contains_all | contains all of the strings | |
contains_any_words | contains any of the words | |
not_contains_any_words | contains none of the words | |
contains_all_words | contains all of the words | |
regex | matches regular expression | (As interpreted by DB) |
not_regex | does not match regular expression | (As interpreted by DB) |
less_than | is less than | Integer or Timestamp |
greater_than | is greater than | Integer or Timestamp |
changed_before | changed before | Timestamp |
changed_after | changed after | Timestamp |
changed_from | changed from | |
changed_to | changed to | |
changed_by | changed by | name of User |
matches | matches | Full text of bug contains the string; use only with special 'content' field |