Open main menu

Extension talk:Bugzilla Reports

BugzillaReports is a wonderful extension that does exactly what it says on the tin, and does it really well! Our organization have been using this extension since its release and we find it invaluable. Nice one Ian!

Geoff Parkes,, 2008



Currently, Bugzilla Reports isn't listed in Special:ExtensionDistributor. Could it be added? --Catrope 16:48, 15 July 2008 (UTC)

Sure, but I'm not sure how that list of extensions gets generated. Do you know if it's driven from the main MediaWiki SVN repository? --Ian Homer 21:26, 16 July 2008 (UTC)

Using same bz db connection as mediawiki oneEdit

A bug was reported which threw the php exception (not a valid MySQL-Link resource) below. This occurred when you use the same bz db connection as the mediawiki one.

sql_real_escape_string(): 41 is not a valid MySQL-Link resource

This has been fixed and will be released in v0.9.1 (coming very soon) --Ian Homer 08:20, 14 August 2008 (UTC)

Bugzilla 3.2Edit

Can someone confirm that this still works with bugzilla 3.2?

Yes, it still works with Bugzilla 3.2 Philippe Lambot

Works with 3.6 just fine, thanks bemoko folks! --gvy

Time restrictionEdit

Is there a posibility to restrict the output to the Bugs changed within the last n days? --Joergens.mi 10:56, 9 December 2008 (UTC)

Try "modified=-3d", e.g.


--Ian Homer 23:59, 9 December 2008 (UTC)

Bug creationEdit

Is there a way to get a report of all the bugs created by person X within the last N days?

-- DaveO 2/28/09

Not quite, but you can generate all bugs that were created by person X and which were modified in the last N days - {{#bugzilla:debug=1||modified=-3d}}. Not the quite the same thing - although it will include all the bugs in that were created by person X within the last N days, but it may include others. If you feel you need the report for "all bugs created by person X within the last N days" could you raise it @ --Ian Homer 18:38, 1 March 2009 (UTC)
You can now do this in v1.1 (beta) - e.g. {{#bugzilla:created=2009-05-01:2009-05-31|}} --Ian Homer 13:36, 24 June 2009 (UTC)


It would be nice to integrate this extension with the Bugzilla addon Testopia -- 19:12, 28 March 2009 (UTC)

Sounds an interesting idea - bugzilla reports is now in google code @ - could you raise this in that list and put a few more details around what you'd like to see. If you have skills in this area, the source is all open and I'd welcome patches to cover new features like this --Ian Homer 20:26, 28 March 2009 (UTC)

Writing number of returned bugs into the variableEdit


Is it possible to write the number of returned bugs (rows) to the variable, e.g. using #vardefine ? Then i'd like to use this variable in #expr.


Yes, try the example below (you'll need to take v1.1 beta to get this to work) --Ian Homer 13:30, 24 June 2009 (UTC)

{{#var:totalnew}} (NEW) + {{#var:totalassigned}} (ASSIGNED) = {{#expr: {{#var:totalnew}} + {{#var:totalassigned}} }} (NEW and ASSIGNED)

Dynamic Filters to bugsEdit

hello, is it possible to implement dynamic filters for a table generated using this extension. so that one could drill down based on the requirement. Thank you

Not sure I understand what you mean by dynamic filters. The arguments can be taken from parameters (e.g. product={{{1}}}) or other MediaWiki extensions, (e.g. product={{#var:myvar}}) - is this what you are looking for --Ian Homer 12:22, 1 August 2009 (UTC)

SQL error when using "|closed=Edit

Hi! I have an error when I'm using |closed=

BugzillaReports : Error running the sql : SELECT DISTINCT bugs.bug_id as id, alias, closedactivity.bug_when as closed, quickflag.flagdate as flagdate, priority, as product, bug_severity as severity, bug_status as status, short_desc as summary, bug_file_loc as url, version FROM bugs LEFT JOIN (SELECT bug_id, MAX(bug_when) as bug_when from bugs_activity where fieldid= and added='CLOSED' GROUP BY bug_id) as closedactivity on bugs.bug_id=closedactivity.bug_id LEFT JOIN (SELECT bug_id as quickflagbugid, MAX(creation_date) as flagdate from flags where status='?' group by quickflagbugid) as quickflag on quickflag.quickflagbugid=bugs.bug_id LEFT JOIN products on where 1=1 and closedactivity.bug_when >='2009-07-28' and bug_status<>'CLOSED' order by priority,bug_status ASC; ERROR: syntax error at or near "and" LINE 1: ...en) as bug_when from bugs_activity where fieldid= and added=...

Could you please,help? In this way I wanted to know the number of closed bugs per week. Thank you!

Yep I spotted this the other day and fixed under - just tested {{#bugzilla:closed=-1m|status=*}} on our local system and it works OK. If you want to pick up the fix for this you'll need to take the release from trunk as described @ since this fix has not made it into a release yet --Ian Homer 22:33, 4 August 2009 (UTC)

"Warnings Were Generated ... Report Truncated Count Greater than Max", etc...Edit

We're migrating our bug database from Test Track, and have imported them into bugzilla with hopes of integrating into our in-house wiki. I have created a report which returns only two records (which agrees with Test Track), keeping it simple and specifying only the component name. Works fine until I add 'lastcomment=1', at which point I get the above message and only the first record.

Since I can link to the actual bugzilla listing, losing the details is not a big deal, but the 'hover bubble' is a cool feature and it would be nice to have it working.

I have tried bumping up the $maxrowsFromConfigDefault (to as much as 1000!) but while this allows the report to complete and display both records, I still get the message. These entries have A LOT of text in their description fields, but there are only two actual records. Is this a bug, or just new user error?

A great extension - much simpler than writing out all the queries using SQL2wiki or the like.

Thanks! Mickeyf

Oops - I discovered the 'troubleshooting' section at the bottom of the page. I have pasted the SQL into phpMyAdmin, it does not generate any errors, but does generate 1362 rows. In the log I note that of the 1362 rows generated, apparently two are being pulled out for rendering.

That looks like a bug. The report truncation is designed so that an administrator can put a cap on how big reports can get, but given that you've upped the $maxrowsFromConfigDefault AND that the behaviour only happens when you add "lastcomment=1" then it's clearly not behaving well. It might be that the counting of the numbers of rows is amiss since this may be counting all the rows with all the joins (of which only a couple of rows are relevant for your report). Log it @ and I'll review this area of the code --Ian Homer 22:57, 18 August 2009 (UTC)

Resolution ParameterEdit

Hi Ian,

In update v0.9.8 - 3rd December 2008 you wrote, that

   * Add support for resolution field, e.g. {{#bugzilla:debug=1|columns=+resolution|resolution=fixed,invalid}}

But when I try using resolution, it returns 0 bugs always. Is it a bug in extension, or I do something wrong?

Thank you, Sergii

Sorry, Ian. I found that resolution fields should be written in capital. Then it works.

Summary CountsEdit


How do I generate a table of bug COUNTS per component for given product? (not a list of bugs but just the counts).

Thanks - Martin

Okay, I think I can answer my own question. After using the canned examples for a while, I came back to this page and paid more attention. Higher up on this page is an example with format=inline. This gives me a number I can use anywhere on the page and format it the way I want. Awesome!

Bugzilla 2.23 supportEdit

Do you have an old version that works for MW 1.15 and Bugzilla 2.23?

No, sorry - only supported on later versions. If you have PHP dev skills you would be able to tweak the code to get support on those versions though ... --Ian Homer 08:06, 8 March 2010 (UTC)

Multiple Bugzilla'sEdit

I would like to use the wiki to report on different bugzilla's. Can I somehow configure bugzillareports to do this?

Thanks a lot for this very nice tool.


The trunk version of this plugin now has support for multiple bugzilla instances thanks to Mark Voelker - check out from . See for documentation

I have had trouble getting multiple instances working as described but the following setup does work for me.

in the LocalSettings.php file

$wgBugzillaReports = array(
 'host'        => "",
 'database'    => "bugs", 
 'user'        => "bugs", 
 'password'    => "mypassword",
 'bzserver'    => "",
      'SecondBZ:host'     => "",
      'SecondBZ:database' => "bugzilla_number_two",
      'SecondBZ:user'     => "bugs", 
      'SecondBZ:password' => "mysecondpassword",
      'SecondBZ:bzserver' => "",
           'ThirdBZ:host'      => "",
            'ThirdBZ:database' => "bugzilla_number_three",
            'ThirdBZ:user'     => "bugs", 
            'ThirdBZ:password' => "mythirdpassword",
            'ThirdBZ:bzserver' => "",

Wiki page

 |priority=P1 - blocker,P2 - major
 |noresultsmessage="No matching bugs found."

column for %CompleteEdit

Can anyone tell me how to add the %complete column?

I have tried


But get error

Warnings were generated during the execution of function

   1. Parameter columns=+to,+from,+%complete is invalid using regex /^[\w,_+-~]*$/

Many thanks --Mark 12:38, 24 March 2010 (UTC)

Extension not runningEdit

  1. Downloaded and installed the extension under /var/lib/mediawiki/extensions/.
  2. Proceeded to modify LocalSettings.php per the installation instructions.
  3. Attempted to test the extension by typing {{#bugzilla:}} in the page editor, but mediawiki failed to interpret the code.

I checked the Special:Version page, and it recognizes that the extension is installed. Any idea what might be wrong?

  • MediaWiki 1.15.1, installed through aptitude on Ubuntu 10.04 LTS.
  • Bugzilla 3.4.2 operating on a separate server, with the bugzilla DB operating on a third server.


Never mind - There was an issue with the BugzillaReports.php file that came with the tarball. Updated it to r58 off google code.
--anonymous 15:19, 10 June 2010 (UTC)

Bugzilla 4.0 - Keywords issue?Edit

For your information.

I just moved to Bugzilla 4.0 and most reports are OK without any change, except the one where I use "|keywords= ...".

I get:

  • Error running the sql: ... Unknown column 'keywords' in 'field list'

Edit BugzillaQuery.php to update:

if ($this->isRequired("keywords")) {
    $sql.=", keywords";


if ($this->isRequired("keywords")) {
    $sql.=", (SELECT group_concat( FROM bugs.keyworddefs WHERE in (SELECT keywords.keywordid FROM bugs.keywords WHERE keywords.bug_id=bugs.bug_id )) as keywords";

It may not be the most efficient way of going about it, but it works. -- Steve

Thanks, this worked for me on BugZilla 4.0.1 -- Josh

I also changed the skin a little bit:

I added:

table.bugzilla tr.VERIFIED td { text-decoration: line-through; }

Because the end state is now VERIFIED and no longer CLOSED: see

For those using postgre rather than mysql, the above works with the following SQL:

$sql.=", (SELECT STRING_AGG(, ',' ORDER BY FROM keyworddefs WHERE in (SELECT keywords.keywordid FROM keywords WHERE keywords.bug_id=bugs.bug_id )) as keywords";

-- Chris

Flag ReportsEdit

I'm looking for some more detail on running reports against bugs that are flagged. In particular if I add a flag and then set that flag on 10 bugs to the "+" value how do I create a report to just display those bugs? Is this possible? I'm not setting these flags as requestable so the "?" value is not being used, only the "-" and "+"

I have same question

Multiple search terms?Edit

detailsrow not workingEdit

Hi there, has anyone got the detailsrow working.

I have added the following but cannot see the detailsrow, I have tried every permutation I can think of,

  • listing columns in both columns and detailsrow
  • not listing in columns

having a look at BugzillaQuery.php I cannot see the detailsrow being used.

  |noresultsmessage=No Tickets found
  |heading=Working on

custom fieldsEdit

We have added some custom fields to our bugzilla, is it possible to run Bugzilla reports on these custom fields ?

I have tried adding

|filters= cf_assigned_sub_status%3DAwaiting%20Product%20Management%20triage

But I get error in SQL with note

 Setting parameter bzalternateconfig is not supported

Does this mean just that the filters wil not work with alternate Bugzilla configurations ?



See the Multiple Bugzilla's entry above I had the same issue




unserialize ErrorEdit

We've installed mediawiki 1.20.2 and Bugzilla Reports extension

The bugzilla db and mediawiki are both on mysql in localhost.

When I add code for bugzilla report, the report is correctly generated but at the top of the page i get this error:

Notice: unserialize(): Error at offset 0 of 126 bytes in C:\mediawiki-1.20.2\includes\objectcache\SqlBagOStuff.php on line 539

Bugzilla 4.4Edit

Bugzilla 4.3 and 4.4 are not listed under #Pre-requisities and it's not clear whether this is a list of all supported version or newer versions will work.. So, will this extension work with bugzilla 4.4? 2aprilboy (talk) 14:30, 8 July 2013 (UTC)

The old version of the extension (v1.1) will work with Bugzilla 4.3 and older. The new version (v1.3) will work with Bugzilla 4.4. CiaranG (talk) 11:55, 4 August 2013 (UTC)

Negated keywords search ignores tickets with no keywordsEdit

When I use |keywords=!ddd, only bugzilla tickets with some keyword(s) in them are included. The bugs without any keyword are not. Is it possible to search for bugs with no keywords? --2aprilboy (talk) 11:18, 15 October 2013 (UTC)

2aprilboy (talk) 11:24, 17 October 2013 (UTC): I'm not familiar with the source code yet, but the change in SQL output needs to be from:
and EXISTS (
       SELECT keywordid,
       from `bugs`.keywords as keywords
       LEFT JOIN `bugs`.keyworddefs as keyworddefs on
       where keywords.bug_id=bugs.bug_id and <> 'xxx'


       SELECT keywordid,
       from `bugs`.keywords as keywords
       LEFT JOIN `bugs`.keyworddefs as keyworddefs on
       where keywords.bug_id=bugs.bug_id and = 'xxx'

Please help with Stand-alone Report -- report.php RESOLVEDEdit

I got it working, so I thought I would share what I found.

I'm not sure whether a new version of mediawiki or PHP broke the report.php code, or whether it never really worked as written. However, now I've got basic functionality and I can refine it from there.
Original Post:

Hi, I've got the basic reporting working fine, even with multiple instances of Bugzilla. I'm trying to get the report.php standalone working, but I'm getting an error.

Fatal error: Call to undefined function wfMsgForContent() in /var/www/html/bugzilla/extensions/BugzillaReports/BugzillaReport.php on line 212.

Here's what I've done so far:

  • My Bugzilla code is loaded in /var/www/html/bugzilla, with the extension unzipped to /var/www/html/bugzilla/extensions/BugzillaReports.
  • Mediawiki is installed on /var/www/html/mediawiki.
  • I copied the value of the $wgBugzillaReports array from my LocalSettings.php file into report.php.

I put the reports.php file into the /var/www/html/mediawiki/ directory, and I initially got an error: init.php was not found.

I changed:




So, that worked, or at least I got past that particular error. Now I'm getting the error shown at the top of this posting.

I have tried various settings for $bzScriptPath, but nothing has worked. Somebody must have this working. What am I doing wrong?

Thanks in advance...


  • I located report.php in the base mediawiki directory.
  • I copied the content of my changes to LocalSettings.php, where the main and alternate Bugzilla databases and usernames and passwords are defined. I set up a user named "reports" and set the password for that user.

$wgBugzillaReports = array(
  'host'        => "localhost",
  'database'    => "zilla_bugs",
  'user'        => "reports",
  'password'    => "reports-password",
  'bzserver'    => "",
  'bzAlternateConfigs' => array(
     'CM_Tools' => array (
         'host' => "localhost",
         'database' => "CM_Tools",
         'user' => "reports",
         'password' => "reports-password",
         'bzserver' => ""
     'ProjectDB_1' => array (
         'host' => "localhost",
         'database' => "ProjectDB_1",
         'user' => "reports",
         'password' => "reports-password",
         'bzserver' => ""
  • I set up that user in mysql for each of the Bugzilla databases.
# cd /var/lib/mysql
# mysql -p
mysql> grant select on zilla_bugs.* to 'reports'@'localhost' identified by 'reports-password';
              (repeat the step above for each of the Bugzilla DBs)
mysql> quit
  • The following changes are required to report.php in order to make it function.
    • Add the following lines above the call $parser=new BParser();
#  This step is done in mediawiki's index.php, but was
#  missing in the original report.php.  It is required!
require __DIR__ . '/includes/WebStart.php';
    • REPLACE the php code at the bottom of the file with the following, and you'll actually get some output:
        print $head;
        print $out;

lastcomment rendered incorrectly on IIS 7Edit

  • Symptoms:
    • When I used lastcomment=1 on IIS 6, it had been rendered correctly as a bubble.
    • Now, I use IIS 7 and lastcomment seems to be rendered somehow inline. The result is, that the screen flickers whenever I move the mouse over a bug line. It looks like "mouseover" inserts the comment between the lines (and therefore shifts the whole screen below and alters the width of the table column(s)), instead of rendering it as a bubble.
  • Result
    • I feel urged not to use lastcomment=1 any more, in spite of I really liked it as a very useful feature, when it worked correctly.
    • Can you please make it compatible with IIS 7 (or tell me what else I might be doing wrong)?
  • Thanks!

Issues with detailsrowEdit

I have some issues when using detailsrow I'd like to see fixed:

  1. That the background alternating color be turned off so that each main row is shaded, and subsequent detail rows are not shaded.
  2. That the detailsrow be it's own table that colspan's the main row columns, having the 1st column be the detailsrowprepend text, and the 2nd and perhaps subsequent columns be the detail.

As it is now, the alternating backgrounds make the report a little confusing, and the detail makes the 1st column wider than it needs to be. Perhaps there is already some solution for this, or maybe I'm doing something incorrectly, but looking through the code I don't see it.

If I could get a push in the right direction, I'm willing to make these changes and contribute.


UPDATE: Took care of #1 with this

if ($even && !$this->query->get('detailsrow')) {
} else {

For # 2 the issue is in the function renderDetailsRow. If the detail is very long, the 1st main column width is bigger than is needed. I fixed this by increasing the base estimated width to 80.

$estimatedWidth=80 + $this->numberOfMainRowColumns * 5;
$this->output.="<div title=\"$title\" class=\"bz_details\" style=\"margin-left:2em;margin-right:-".$estimatedWidth."em;overflow:auto\">";

UPDATE: The change I made for #2 isn't really working out either. What I've done now is to make detailrow(s) additional table rows, and the detailsrowprepend (if provided) a table header above any details. The rows are set to colspan the entire width of the table. I split off the renderDetailsRow into a new renderDependsBlockRow for the calls made for depends and blocks, and changed the leftover renderDetailsRow to suite my needs. I'll work on getting this committed and released.

These changes are now located in the 1.4 branch.

Google Code Shutting DownEdit

Hello, As you are likely aware, Google is shutting down their Google Code service in January of 2016. This extension appears to house its code with Google Code and is at risk to creating broken links and confusion of users in the near future.

I’m helping to let folks know about this coming update and provide some helpful links to make this migration easy. I hope you’ll take a moment and migrate your extension to a new hosting solution.

For extensions that have a compatible license, you can request developer access to the MediaWiki source repositories for extensions and get a new repository created for you. Alternatively, you may also export your code to other popular repositories such as Github and Bitbucket. Google has provided tools to help with this migration.

Ckoerner (talk) 17:15, 7 July 2015 (UTC)

Martin Sugioarto picked up development of this extension at and rewrote it to Bugzilla 5.0 (at this time only 5.0 and newer is supported without compatiblity for older Bugzilla versions) --Hendrik Brummermann (talk) 10:05, 10 September 2015 (UTC)
Return to "Bugzilla Reports" page.