Created
October 28, 2011 06:46
-
-
Save vividtone/1321763 to your computer and use it in GitHub Desktop.
Redmineの日ごとのチケット作成件数を表示
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# issue_creations_report.rb | |
# | |
# Redmineのチケットの日ごとの作成数を表示 | |
# | |
# 使い方: | |
# Redmineのインストールディレクトリで以下のように実行。 | |
# | |
# script/runner -e production issue_creations_report.rb | |
# | |
issues = Issue.find(:all, :order => 'created_on') | |
prev_date = nil | |
current_date = nil | |
issues_count = 0 | |
issues.each do |issue| | |
current_date = issue.created_on.to_date | |
if current_date != prev_date && issues_count > 0 | |
puts "#{prev_date}\t#{issues_count}" | |
issues_count = 1 | |
prev_date = current_date | |
else | |
issues_count += 1 | |
end | |
end | |
puts "#{current_date}\t#{issues_count}" if issues_count > 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment