There is a simple although round-about way to produce a Bugzilla query with an explicit list of bugs numbers.
Begin on the Bugzilla search page. That might be something like
http://bugs/query.cgi
on your system. Set up your search criteria in the usual way. When you click the “Search” button, the URL will contain the details of your search. For example:
http://bugs/buglist.cgi ?query_format=advanced &short_desc_type=allwordssubstr &short_desc= &product=MyProduct &component=MyComponent &target_milestone=1.2.4 &target_milestone=1.2.5 &long_desc_type=substring &long_desc= &bug_file_loc_type=allwordssubstr &bug_file_loc= &status_whiteboard_type=allwordssubstr &status_whiteboard= &bug_status=UNCONFIRMED &bug_status=NEW &bug_status=ASSIGNED &bug_status=REOPENED &emailassigned_to1=1 &emailtype1=substring &email1= &emailassigned_to2=1 &emailreporter2=1 &emailqa_contact2=1 &emailcc2=1 &emailtype2=substring &email2= &bugidtype=include &bug_id= &votes= &chfieldfrom= &chfieldto=Now &chfieldvalue= &cmdtype=doit &order=Reuse+same+sort+as+last+time &field0-0-0=noop &type0-0-0=noop &value0-0-0=
(I’ve split the URL over several lines to make it easier to read.)
This URL may be used to communicate a dynamic bug list to a colleague. The result of such a URL, however, will vary over time as the state of the bugs change.
Such a query can often be cut down, by removing fields from the query that are empty, associated with another empty field, are unimportant, or have a default value. For example:
http://bugs/buglist.cgi ?query_format=advanced &product=MyProduct &component=MyComponent &target_milestone=1.2.4 &target_milestone=1.2.5 &bug_status=UNCONFIRMED &bug_status=NEW &bug_status=ASSIGNED &bug_status=REOPENED
This might be more convenient sometimes. There is a possibility, though, that a cut-down URL like this might produce different results on Bugzilla accounts with different default settings.
Alternatively, from the full URL, select any bug in the list, and then follow the link “Show last search results”. The URL will now be
http://bugs/buglist.cgi?regetlastlist=1
Clearly, this is ‘stateful’, i.e. is dependent upon the state of the querying account. Now follow the “Edit search” link.
Lo and behold, the only search criterion is now the “Only include bugs numbered” field, which might contain something like
1234,1357,2345
and the URL will now be something like
http://bugs/query.cgi?bug_id=1234%2C1357%2C2345 &field-1-0-0=bug_id &query_format=advanced &type-1-0-0=anyexact &value-1-0-0=1234%2C1357%2C2345
where “%2C” has been used to encode the comma. Now click the “Search” button. The URL will now be something like
http://bugs/buglist.cgi?query_format=advanced &short_desc_type=allwordssubstr &short_desc= &long_desc_type=allwordssubstr &long_desc= &bug_file_loc_type=allwordssubstr &bug_file_loc= &status_whiteboard_type=allwordssubstr &status_whiteboard= &emailtype1=substring &email1= &emailtype2=substring &email2= &bugidtype=include &bug_id=1234%2C1357%2C2345 &votes= &chfieldfrom= &chfieldto=Now &chfieldvalue= &cmdtype=doit &order=Reuse+same+sort+as+last+time &field0-0-0=noop &type0-0-0=noop &value0-0-0=
This URL may be used to communicate a static bug list to a colleague.
It could be cut down to just
http://bugs/buglist.cgi?query_format=advanced &bug_id=1234%2C1357%2C2345
Summary of the steps to produce a static bug-list URL:
- Enter search criteria on e.g. http://bugs/query.cgi
- click “Search” button
- select any bug
- follow “Show last search results” link
- follow “Edit search” link
- click “Search” button
- (optionally) edit the URL
Monday, 12 March 2012 at 21:21 |
Hi,
I must say, this is really good article and it’s been very helpful to me. I’ve been trying to find more information on bugzilla search urls in official documentation, but so far I’ve been unsuccessful. I was just wondering, do you happen to know where I could find some more information about this? Mainly url parameters and possible values and such.
Thanks in advance,
Joe
Tuesday, 13 March 2012 at 22:23 |
Thanks for the reply.
These notes were produced following guesswork and experimentation.
No, sorry. If it’s not in the official documentation, then I don’t know. (Certainly a Google search didn’t seem to come up with anything helpful.)
O’Reilly publish books on such things, which are usually excellent; unfortunately, I couldn’t find one on Bugzilla.
You could try the suggestions on Bugzilla Support.
Alternatively, you could try searching and/or posting questions on either Stack Overflow or Super User.
Hopefully, someone else will post a reply that is more directly useful to you…
Rob.