Extension:Bugzilla Reports

BugzillaReports generates great looking reports from Bugzilla which you can include in your MediaWiki pages (or in fact any PHP application). Great to provide access to Bugzilla info, for example:


 * 1) Generate release notes when you release
 * 2) Generate roadmap reports for what's coming in a future release
 * 3) Generate your personal task radar - what should you be doing next
 * 4) Access controlled reports - if you want to expose bugzilla summaries to those who don't have access to Bugzilla
 * 5) Provide reports easy for non-techies to read.

Displays dependency reports, last comments for bug when you hover over the bug, supports interactions with voting & flagging and helps you to see what needs to be done next. Read below for more bells and whistles. Makes reporting on your bugs much easier than through the standard Bugzilla search UI. It's your controlled window onto Bugzilla ...

See here for an active discussion thread on this extension.

''If you have requests for what will be included in the release after this one then email me at bugzillareports -at- bemoko.com if you want to add anything to this list (or ... find any bugs). I'm preparing the v1.0 (stable) release. For this v1.0 release I'd welcome any corrections updates to this page to get these docs up to date - lots of features have gone in the past few months that documented in the release notes at the bottom of this page, but not in the "learn by examples" below. Anyone who does some updates to the docs will get in the credits.'' --Ian Homer

=Pre-requisites=


 * Bugzilla 3.0.x (or Bugzilla 3.2.x)
 * MediaWiki 1.13
 * MySQL or PostgreSQL

=Installation=


 * 1) Download the extension bundle from BugzillaReports
 * 2) Unpack bundle into your extensions directory.  This should give you
 * BugzillaReports/BugzillaReports.i18n.php
 * BugzillaReports/BugzillaReports.php
 * BugzillaReports/skins/bz_main.css
 * etc

Add the following to your LocalSettings.php file:

or if you want to use interwiki links (which is recommended and worth the extra effort of setting up)

where parameters are defined as follows:


 * 1) host &rArr; defaults to localhost, but if Bugzilla not on same machine as your mediawiki install then set the hostname here
 * 2) user and password of the database user with read access to the bugzilla database
 * 3) To get the bugs to link through to Bugzilla server, use one of:
 * 4) bzserver &rArr; the URL of the bugzilla server for which the click through links should point to e.g. http://host".  Note that the path "/show_bug.cgi?id=" is automatically added for you by the extension
 * 5) interwiki &rArr; interwiki prefix linking to bugzilla instance
 * For example set up interwiki prefix of bugzilla to point to URL http://host/show_bug.cgi?id=$1
 * 1) maxrows &rArr; set maximum number of rows to display (defaults to 200)
 * 2) maxrowsbar &rArr; set maximum number of rows to use in bar chart generation (defaults to 500)

PostgreSQL
=Example Output=



Note that the bubble appears as you roll over a bug that has a last comment set.

=Usage=


 * Note that several features are described in the release notes below and have not yet been documented in this section. I anticipate reflecting these changes in the documentation prior to the v1 release.  Apologies for this gap in information, it should only be temporary --Ian Homer 22:10, 21 October 2008 (UTC)

By Example
Generate a report from Bugzilla based on search criteria, e.g.



List all open bugs - note that status defaults to NEW,ASSIGNED,UNCONFIRMED,REOPENED and maximum of 200 rows (by default) are returned. Results are sorted by priority.

Report on P3 and higher bugs

Report on a particular product version

Report on specific bug ids

Report on all enhancements with the text wiki in the summary with last comment bubbles

Setting the lastcomment parameter will generate a report which renders the last comment in bundles in bubbles as you hover each row (see image left) This has been tested on Firefox 3 and Safari 3, but this option may have issues with other and older browser. I'd be happy to hear feedback on this feature.

Report on all bugs that are not new

Everything except P1 and P2 bugs

Set the message when no results are returned

Tasks with votes against them





All tasks created by me but not assigned to me

All tasks I'm cc'd on but not created by me and not assigned to me

Display list in a format that's handy for cutting and pasting into emails

for example:


 * [IHO] (2008-07-22) Do something (#19)
 * [IHO] (2008-07-25) Do something else (#45)
 * [JBL] Don't forget this (#54)

Task Radar
This example gives you an idea of how to use the Bugzilla Reports extension to report on what you should be doing next:

where task radar is defined as:

Parameter Usage
All query fields can take the following constructs


 * value - single value to match
 * value1,value2, value3 - comma separate list of value to match
 * !value - match on everything except value
 * !(value1, value2, value3) - match on everything except the listed values
 * "*" - match on everything (useful to override inbuilt default of status)
 * "+" - match on not null
 * "-" - match on not set

With Semantic MediaWiki
This extension works well with the Semantic MediaWiki by


 * 1) tagging your page with a property, e.g. task::52
 * 2) and then passing the results of semantic search into the bugzilla reports function, e.g.

=Troubleshooting=

If you are having any issues with the use of this extension please

 include the following in your LocalSettings.php file

(Feel free to use any other location for your logs if /tmp is not appropriate)

Include debug=1 in your bugzilla function call

 If the error is related to a SQL failure then you might want to try the SQL command (as shown with the debug=1 enabled) directly in the SQL command line and observe the behaviour Send to me, along with a description of the issue, the output of this log, a copy of the call and the relevant output from the wiki page. 

=Release Notes=

Download latest release from

v0.9.9 - 21st December 2008

 * BUG : Warnings in log files - "Missing argument 2 for BugzillaReport::getProperty" and "Undefined variable: where in" - warnings resolved
 * BUG : "depends" and "blocks" query fields were not working - now they do.

v0.9.8 - 3rd December 2008

 * Add support for resolution field, e.g.
 * Provide wildcard support to match for any version like 1.% and  to match for any version not like 1.%
 * Allow filtering by custom fields using the generic "filters" argument, e.g. will search for all bugs for which the cf_application_server is like 'Tomcat%'.  Note that %3D is URL encoding for '='. Multiple filters can be applied by separating each filter by a '%26' (i.e. URL encoded '&'), e.g.
 * BZ enforces and encourages all custom fields to start with "cf_" however if you start the custom fields with an alternative prefix you can override this with the parameter customprefix.
 * The parameter 'disablecache' can now be set to "1" in the $wgBugzillaReports LocalSettings.php configuration to disable the cache for all BugzillaReports pages - please note that this will affect performance of the pages, but will dynamically update the bug information for the page each time the page is accessed. e.g $wgBugzillaReports = array(...other parameters ..., 'disablecache' => "1" );
 * Allow alternative bugzilla instances to be used by setting the "instance" parameter, e.g. . These alternative instances are configured in the $wgBugzillaReports LocalSettings.php configuration using the appropriate namespaced parameters for the instance, e.g. $wgBugzillaReports = array(...other parameters ..., 'instance1:host' => "localhost",'instance1:database' => "myotherbugs",'instance1:user' => "bugs").  If no parameter exists for the given instance then the default values (i.e. those without a namespace) are used
 * Support comparisons in filter fields, e.g. to search for all bugs higher than P4 and  to search for all bugs higher than version 0.9.  Note that this is a simple SQL greater than or less than execution and hence follows the SQL comparison logic.
 * BUG : Sorting wasn't using the same naming as the field naming, it does now, e.g. you can use now, previously you had to use  for this

v0.9.7 - 21st October 2008

 * Allow column names to be set by, e.g. columns=+field:myfieldname, where "field" is the column name and "myfieldname" is the name of the column
 * Support custom fields in the columns and sort parameter, e.g. columns=+cf_customer and sort=+cf_customer. This can be used in conjunction with the column name feature above to include the column with, e.g., columns=+cf_customer:Customer.  Note that custom fields MUST start with "cf_" as enforced in recent Bugzilla version by Bugzilla console.
 * Support for url-style decoding of fields (with SQL injection safety check - e.g. you can't do quotes) so product=%21MyProduct will search for bugs against product "!MyProduct". Note that product=!MyProduct will search for bugs not against product "MyProduct" hence the need to encode
 * Support multiple nested grouping levels, e.g. group=status,severity,priority,version
 * Support disabling of mediawiki cache for page so that report is dynamically generated from bugzilla database each page refresh, this is a performance hit so this caching is enabled by default, but this gives you the control to choose.
 * BUG : Some characters were showing as ?. Support has now been provided to control the db encoding - set $wgBugzillaReports = array( ... 'dbencoding' => "utf8" ...) in LocalSettings to set db encoding.  Default is "utf8", so if your database is using UTF-8 then you don't need to use this setting.
 * BUG : Fix issues with some characters either corrupting the mediawiki page or not rendering the report at all.
 * BUG : Fix bug where ! in field string caused failure

v0.9.6 - 9th October 2008

 * Support relative date searches, e.g. deadline=+1w (anything with a deadline in less than a week), modified=-1m (anything modified in the last month), deadline=-5d:+5d (anything with deadline in the past 5 days or in the next 5 days)
 * Support for qa field - e.g. or
 * Include keywords bubble inside lastcomments bubble. By default each keywords is clickable through to a wiki page called "keyword mykeyword" (where mykeyword is the given keyword)
 * Support for format=count to display count of bugs
 * If number field is 0 then render number as empty string, e.g. if number of votes is 0 then it render as blank
 * Support link attribute to define which column value (or group heading) should link through to a wiki page, e.g. link=milestone~myproduct,component, will link the milestone column to 0.1 (if milestone value is "0.1") and link the component column to ui (if the component value is "ui"). The ~ acts a separator to allow you to define a prefix of the linked page.
 * Setting parameter "sortable=1" provides client side sorting of table. This uses alphabetic sorting and not Bugzilla sort orders, nor numeric sorting.  It is not supported alongside groups and barcharts.
 * Setting parameter "debug=2" generates more verbose debugging, including full dump of HTML report output
 * BUG : More accurately calculate bug count value for format=count

v0.9.5 - 25th August 2008

 * Support for range comparisons on modified, e.g. "columns=+modified|modified=2008-07-01:2008-08-01|modifiedformat=date|sort=modified" for everything modified in july and format modified as date (as opposed to the default relative symbols)
 * BUG: Correct missing ?php at the beginning of BugzillaQueryRenderer which was leading to php script not processing on some platforms

v0.9.4 - 23rd August 2008

 * Support usage of BugzillaReports outside of MediaWiki install and in any PHP application of your choice
 * Separate out query renderer from query execution in preparation for mobile rendering
 * BUG: Support spaces in field values in the bugzilla link. Note that this link can be turned off by setting bzurl=hide

v0.9.3 - 22nd August 2008

 * Added link to take you to the query in Bugzilla - link appears as a double arrow to the right of the summary column. Note that wgBugzillaReports property bzserver must be set to enable this functionality.
 * Support for search on keywords, i.e. keywords=php - courtesy of Gary Helmling of meetup.com
 * BUG: If you explicitly truncate table with maxrows in the parser function call then the warning "Report truncated" is now not displayed
 * BUG: Fixed combination of explicit id and lastcomment not working, e.g. id=47,256|lastcomment=1
 * BUG: Addressed warning mysql_free_result: supplied argument is not a valid MySQL result which was coming about from incorrect db access checking. Note that this bug was not having any known functional side affects other that the warning log message.

v0.9.1 - 14th August 2008

 * Support comma separated sort, e.g. sort=status,priority
 * Add status in grey font at end of depends / blocks row
 * Added support for "estimated", "remaining" and "work" field
 * Added support for totals of rows, e.g. "total=estimate, remaining" provides a total summary at end of row. This can be used in conjunction with group to display sub-totals, e.g. "|total=estimate,work remaining|group=milestone|hide=true" would create a report of the estimated time, worked time and remaining time for each milestone.
 * Implement hide function to hide rows from the display (useful in conjunction with the total function to display just totals)
 * Set default sort to priority,status
 * Support for dependsstatus=... to specify criteria for display depends (and blocks rows) e.g. dependsstatus=!(CLOSED,VERIFIED) will not display CLOSED and VERIFIED tickets in dependency or blocks report.  It defaults to !(CLOSED,VERIFIED,RESOLVED)
 * BUG: allow query fields with "-" and "/" in
 * BUG: fix issue with search query not working
 * BUG: allow query fields with "-" in
 * BUG: Fix Undefined index - BSQLQuery.php on line 121
 * BUG: Support use of the bugzilla connection being the same as the mediawiki connection

v0.9 - 21st July 2008

 * Support for postgres wgBugzillaReports in LocalSettings.php
 * 'dbdriver'	=> "pg" (note defaults to mysql)
 * Format modified column with relative dates
 * +++ => modfied in last hour
 * ++ => modfied in last day
 * + => modified in last two days
 * - => modified in last three days
 * . => modified in last 4 days
 * text description, e.g. < 1 day, pops up on roll over.
 * Don't display column headings if there's explicitly one task, i.e. explicitly set single id or alias
 * Support grouporder for ordering of grouping (desc or asc), also implicitly sort modified grouping with desc
 * Use autoloading of classes
 * BUG: Display column if field match set to any, e.g. status=*

v0.8 - 13th July 2008

 * Support heading which includes the heading (as an H1) above the report (only if there is content)
 * Support for empty noresultsmessage, if it's set to nothing then no no-results message will be displayed
 * Support for milestone search query and column name
 * Refactoring to improve supportability and future extensions
 * Support for "allow_call_time_pass_reference = Off" in php.ini without warnings
 * Clear up all warnings with "error_reporting =  E_ALL" set in php.ini
 * Display tasks which a task is dependent on with "depends=*" and anything which blocks with "blocks=*" - assignee and status displayed on roll over (in the td title)
 * By default the real name is display for cc,to, from, etc names. If you want the login name to be displayed set "nameformat=login"
 * Support for name format as a succinct three letter acronym, e.g. Joe Blogs would be JBL and Jane Doe would be JDO, set "nameformat=tla" to enable this
 * Provided a simple list format configured by setting "format=list" which generates a list of tasks handy for cutting and pasting into an email
 * Support for alias in column and query
 * A little faint "+" appears next to any value if there's extra info when you roll over the value, for example if an alias is set then you see a little "+" and see the alias name when you roll over

v0.7 - 4th July 2008

 * Regression Warning : There were some inconsistencies and bugs relating to the naming fields in query field parameters, sort parameters and column parameters. This naming has been simplified and made consistent, however it does mean that the use of functions should be adjusted inline with this release.  Naming is now as follows:
 * status (instead of bug_status), severity (instead of bug_severity), id (instead of bug_id), summary (instead of short_desc)
 * Warnings now output to page to make troubleshooting easier
 * Implicitly add column to provide url associated with task. Column doesn't have a header so if no rows have urls then nothing shows up.
 * Provide support for last modified with the parameter, modified=+ or sort=modified|order=desc
 * Added group feature, e.g. group=product to group the report into different products, including groupformat=radar to render headers for dates as today, tomorrow, this week etc ...
 * Added experimental bar chart feature - e.g. bar=priority groups all rows into a bar chart of different priorities. I say experimental, since doesn't look great yet, but it's functional.

v0.6 - 1st July 2008

 * Fix setting of implicit sorting when some query fields set
 * Fix bug relating to array_fill_keys mandating two parameters

v0.5 - 1st July 2008

 * Optimise SQL to only do joins when needed
 * Support search on component name, component=mycomponent
 * Support for vote reporting, columns=+votes to include votes column and votes=+ to display only tickets with votes against them
 * Significant refactoring to make extension easier to maintain and to allow further DB integrations to be developed (including abstractions from mediawiki) - I expect to do be doing a vTiger MediaWiki extension in the coming months, and I've had feedback that people would like to run this functionality outside of mediawiki.
 * Implicit sort and ordering based on query parameters if no explit sort and ordering set, for example if you say you want to list all rows with deadline set, then sorting will be on deadline (unless explicitly set otherwise)
 * Support for "from","to" and "cc" meaning respectively who raised the ticket, who's it assigned to and who's cc'd
 * Renamed column and query field login_name to "to" (requires changes to any function calls which make reference to login_name)
 * Support for reporter query field and column, e.g. from=me@bemoko.com and columns=+from
 * Support for query field on cc, but note that comma separated and not operators are not supported for this field.
 * Implicity remove columns if query set for a single value, i.e. all values in the column would be the same
 * Implicity add columns if query set for not null, e.g. votes=+ or deadline=+ would implicitly add the deadline and votes column
 * Support query for flagged tasks, e.g. flag=+me@bemoko.com
 * Make sort on deadline put earliest date first and nulls at end

v0.4 - 30th June 2008

 * Fix query for free text match - using search parameter
 * Changed default status to !CLOSED
 * Default maxrows changed to 100
 * Support maxrows as parameter into function call (as well as server config max) - note function call value can't be higher than server config value
 * Support spaces in comma separated query list
 * Default columns changed to "bug_id,priority,bug_status,bug_severity,version,name,short_desc" with login_name removed
 * Support adding and removing columns from the default by using "column=+deadline" or "column=-name", or "column=+deadline,-name"
 * Support sort, e.g "sort=deadline" and ordering "order=desc"
 * Support search for deadline set "deadline=+" and deadline not set "deadline=-"
 * Change "name" column to "product" to make it more obvious and consistent

v0.3 - 26th June 2008

 * Improve UI rendering of lastcomment bubbles
 * Fix the css to get tables rendered better
 * Improved error handling of mysql_query

v0.2 - 26th June 2008

 * Render last comment for a bug in jQuery bubble - use the lastcomment parameter
 * Support for negation of query fields
 * Installation download bundle provided

v0.1 - 25th June 2008

 * Baseline reporting functionality