aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bugzilla.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/bugzilla.rb b/bugzilla.rb
index 16ad676..fe8a2b5 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -476,6 +476,40 @@ class BugzillaPlugin < Plugin
end
end
+ # Produce support of all bug status counts
+ def bugstats(m, params)
+ begin
+ if params[:zilla]
+ check_zilla(params[:zilla])
+ zilla = @zillas[params[:zilla]]
+ elsif get_zilla(m)
+ zilla = get_zilla(m)
+ else
+ m.reply "Wrong parameters (no bugzilla specified), see 'help bugstats' for help."
+ return
+ end
+
+ title = "#{zilla.name.capitalize} bug status totals"
+
+ # Build our URL
+ query = 'x_axis_field=bug_status'
+ #status.each { |s| query += "&bug_status=#{s}" }
+ #reso.each { |r| query += "&resolution=#{r}" }
+
+ # Get the data
+ results = zilla.report(query)
+
+ # Remove the CSV header
+ results.shift
+
+ # Display output
+ m.reply title+" "+(results.map { |b| "#{b[0]}(#{b[1]})" }.join(' '))
+
+ rescue ::Exception => e
+ m.reply e.message
+ end
+ end
+
# Produce architecture statistics using Bugzilla reports
#
# Using the bugzilla reporting functionality, we can produce a
@@ -878,6 +912,16 @@ plugin.map 'bug :zilla :number',
:action => 'bug',
:auth_path => 'view'
+plugin.map 'bugstats :zilla',
+ :requirements => {
+ :zilla => /^[^ ]+$/,
+ },
+ :defaults => {
+ :zilla => nil,
+ },
+ :action => 'bugstats',
+ :auth_path => 'view'
+
plugin.map 'archstats :zilla :status :reso',
:requirements => {
:status => STATUS_INPUT_N,