Hi – I’ve just released an update to the bugzilla reports extension for MediaWiki – see BugzillaReports @ MediaWiki. We use this internally and find it very useful for generating slice and dice reports of our activities. Feel free to give it a try and contact me if you have any questions.
UPDATE: You can report issues or raise enhancements @ http://code.google.com/p/bugzillareports/issues/list



Thanks for your quick response. The filter function works well on my side. I have another question for query, could we define query using Boolean Charts ‘OR’? For example, I want to list all S1 or P1 bugs, is it supported? Thanks again!
You can do an or with a comma, e.g.
{{#bugzilla:priority=P1,P2|sort=severity,status,deadline|status=!(RESOLVED,CLOSED)}}
list all P1 or P2 tickets which are not RESOLVED or CLOSED and sort by severity, status and then deadline.
Ian, that’s not what I want it. I want to list the bugs has P1 priority or critical severity. Current I only know the way to list the bugs had both P1 priority and Critical severity. {{#bugzilla:priority=P1|Severity=critical |status=!(RESOLVED,CLOSED)}}
Echo, OK – currently you can only do that as two separate lists. If you want to see this feature in the future could you raise a ticket @ http://code.google.com/p/bugzillareports/issues/list
Got it. Thanks very much!
Hi,
This is a great application. I was hoping you can help me out with this report I am trying to build using this application. Basically I am trying to get a report which lists the number of bugs each user has logged each day for the last 7 days.
The report would have something like:
Date|Reporter|Bugs Reported
and the values would be something like:
2009-11-11|Joe|3
2009-11-11|Tina|2
2009-11-12|Tina|3
…
Would it be possible to do something like this?
You can achieve something functionally like this with
{{#bugzilla:debug=1|columns=created,from,summary|total=summary|hide=true|debug=1|group=created,from|created=-1m}}
or with explicit list of bugs (instead of just total) as
{{#bugzilla:debug=1|columns=created,from,summary|total=summary|debug=1|group=created,from|created=-1m}}
perhaps not as tidily presented as you suggest, but should allow you to get the data. If you would like to see the report presented in a better way then could you raise a request @ http://code.google.com/p/bugzillareports/
Thanks,
Ian
Hi,
your extension is absolutely great. I have one questin. My input look like:
{{#bugzilla:
|product=IMM_SUP
|status=RESOLVED
|columns=+to,work
|created=XX
|total=work
}}
In created parametr I would like to set only last month. It means, today is 6.1. I would like to see last 6 days.
I have tried this way:
|created=-echo (int)date(d);d
But output look like Parameter created=-6d is invalid using regex /^[\*\w+-:]*$/
Is there any way to set this???
Thanks a lot
Sorry, there was a mistake..:-)
{{#bugzilla:
|product=IMM_SUP
|status=RESOLVED
|columns=+to,work
|created=-echo (int)date(d);d
|total=work
}}
echo (int)date(d); is run by phprun
If you set created explicitly to “-6d” does it work OK for you. I’ve just tested {{#bugzilla:created=-6d}} and it returns the last 6 days. If this does work for you then maybe the report is conflicting with the phprun code.
Currently no way from configuration point of view to disable the validation, but if you want to test things out in the code the validation is done in the BMWExtension.php#extractOptions which gets the validation rules from BSQLQuery.php#getParameterRegex.
By the way the function to display all ticket from this month / last month etc is planned for next release – see http://code.google.com/p/bugzillareports/issues/detail?id=42
HI, thanks for working in this great extension.
I want to do a fairly simple report but cant get it to work.
I just want to display all the bugs that are either RESOLVED, CONFIRMED, OR CLOSED in the last week.
Is there a generic ‘date’ field that you can set to only bring back items within the date range?
Yes – you can do something like …
{{#bugzilla:debug=1|modified=-1w|status=RESOLVED, CONFIRMED,CLOSED|columns=+modified|modifiedformat=date|sort=-modified|}}
(I’ve also added a reverse sort here and included the modified column in the report)
How do I get the %complete column output ?
Thanks
Mark
Also found issue with bar=status
{{#bugzilla:
|milestone=rel_4_5_8
|bar=status
}}
It seems to have 2 issues
1) it is showing totals around status bar
2) it has 2 Resolved, but does not show (2), where Assigned etc do
what am i doing wrong.
Thanks
Mark
%complete currently not supported – could you raise a request @ http://code.google.com/p/bugzillareports/issues/list?
Cheers,
Ian
Could be a bug. Could you raise an issue at http://code.google.com/p/bugzillareports/issues/list and include a screen shot of what you’re seeing?
Cheers,
Ian
Is it possible to use the extension on “regular” php pages? Can you suppy some start points?
Yes – take a look at the example that ships with plugin @ http://code.google.com/p/bugzillareports/source/browse/trunk/report.php
Is “closed” supported? when trying $out=$bugzillaReport->render(array(“columns=id,to,component,priority,severity,status,summary”,”closed=-1w”));
I got empty page and this:
Fatal error: Call to undefined function wfLoadExtensionMessages() in /var/www/html/BugzillaReport.php on line 184
(same qeury with “created” works well)
ahh … it looks like the error message handling is not working in standalone mode …
the following function in BugzillaReport.php :
public function getErrorMessage($key) {
$args = func_get_args();
array_shift( $args );
wfLoadExtensionMessages( ‘BugzillaReports’ );
return ‘BugzillaReports : ‘.
wfMsgForContent($key,$args).’‘;
}
wfLoadExtensionMessages is a MediaWiki function and this method really needs a safety check in case this is run out side of MediaWiki. If you could file a bug for this over at http://code.google.com/p/bugzillareports that’d be helpful.
However essentially, we see the underlying error that is being masked by this error handling issue, if you could change the getErrorMessage function to …
public function getErrorMessage($key) {
$args = func_get_args();
array_shift( $args );
return $key.join($args);
}
and then rerun the query then this should give us a clue as to the underlying issue
Issue filed.
Running the query raised that:
SELECT DISTINCT bugs.bug_id as id, alias, closedactivity.bug_when as closed, components.name as component, quickflag.flagdate as flagdate, priority, bug_severity as severity, bug_status as status, short_desc as summary, profiles.realname as assignedto FROM `bugs`.bugs LEFT JOIN `bugs`.components on bugs.component_id=components.id LEFT JOIN (SELECT bug_id, MAX(bug_when) as bug_when from `bugs`.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 `bugs`.flags where status=’?’ group by quickflagbugid) as quickflag on quickflag.quickflagbugid=bugs.bug_id LEFT JOIN `bugs`.profiles on bugs.assigned_to=profiles.userid where 1=1 and closedactivity.bug_when >=’2010-05-20′ and bug_status’CLOSED’ order by priority,bug_status ASC; You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘and added=’CLOSED’ GROUP BY bug_id) as closedactivity on bugs.bug_id=closedactiv’ at line 1
Seems like no closedactivity in my bugzilla db..
Actually when reviewing the sql, seems like the problem is this:
…where fieldid= and added=’CLOSED’…
Shouldn’t it be set to 9 (bug_status)?
Yes – that looks like the issue. These ids should have been initialised in the function initFieldIds($db) in BugzillaQuery.php. Could you put debug logging on (http://www.mediawiki.org/wiki/Extension:Bugzilla_Reports#Troubleshooting) and see if this method is running through. You should see a log line saying “Registering field ids” if it is.
Getting this to screen:
Registering field ids : 57
And seems ok as SELECT * FROM bugs.fielddefs f; also returns 57 rows…
Thanks for helping so far, I’m not a PHP guy
Another question – why the generated SQL contains this in the where clause: and bug_status’CLOSED’ ? A reminder, I’m looking for bugs closed in the last week.
Barak – I’ve copied the post on your issue to a new ticket called “closed=-1w not working in standalone mode” @ http://code.google.com/p/bugzillareports/issues/detail?id=55 … it’ll be easier to sort this out their without overloading these blog replies
this is embarassing, but I’ve followed all the instructions, and still all I get is the verbatim “{{#bugzilla:}}” text on my wiki page. Versions of mediawiki and bugzilla are up to date, I’ve tested the db connection, and the extension is even correctly listed on my wiki’s version page. What noob thing am I missing to get mediawiki to actually use the extension as it should?
the line in BugzillaReports.php
70 $wgParser->setFunctionHook( ‘bugzilla’, ‘efBugzillaReportsRender’ );
results in
Parameter 1 to Language::getMagic() expected to be a reference, value given in [...]/userwiki/mediawiki-1.15.3/includes/StubObject.php on line 58
It might be related to a conflict with your php version and mediawiki core – see http://code.google.com/p/bugzillareports/issues/detail?id=41 where there’s a work around described
Thanks Ian, you are correct. Its actually using current php version on “old” mediawiki. Gotta love php. Its fixed and the extension is working fine. Great job!
next question:
A lot of our reports depend on a few custom fields. I see that i can run queries based on custom fields with the “filter=” option, but it only supports equals (=). I need to test if a custom field is greater than a defined value. Is this possible?
Glad, that helped. On the custom fields, sorry, but the custom field filtering is currently limited to equality check.