Bugzilla trick: Static Bug List URLs.

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:

  1. Enter search criteria on e.g. http://bugs/query.cgi
  2. click “Search” button
  3. select any bug
  4. follow “Show last search results” link
  5. follow “Edit search” link
  6. click “Search” button
  7. (optionally) edit the URL
About these ads

3 Responses to “Bugzilla trick: Static Bug List URLs.”

  1. Joe Says:

    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

    • Rob Says:

      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.

  2. Srikanth Says:

    Hi, excellent post. This is exactly what I wanted. Thanks for blogging it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: