Skip to content

Instantly share code, notes, and snippets.

@index0h
Last active September 27, 2017 15:45
Show Gist options
  • Save index0h/f3813499597155bfc6f8 to your computer and use it in GitHub Desktop.
Save index0h/f3813499597155bfc6f8 to your computer and use it in GitHub Desktop.
report_redmine.js
var result = {};
$('.time-entry').each(function () {
var $subject = $(this).children('.subject');
var $tracker = $subject.children('a').text();
var $issue = $subject.contents().last().text().substring(2);
var task = '[' + $tracker.replace(' ', '') + '][' + $issue + ']';
var time = $($(this).children('.issue-hours')[0]).text() * 1;
if (!result.hasOwnProperty(task)) {
result[task] = time;
} else {
result[task] += time;
}
});
var dump = '';
for (key in result) {
dump += "\n" + key + "\t" + result[key];
}
dump += "\n\n";
console.log(dump);
@index0h
Copy link
Author

index0h commented Feb 29, 2016

  1. Заходим в редмайн и выбираем spent_time
  2. Выполняем в консольке данный скрипт
  3. Полученную результат впихиваем в отчет

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment