ucan-lab / tips

5 stars 0 forks source link

Backlogの予定時間と実績時間の合計値を計算する。 #33

Open ucan-lab opened 6 years ago

ucan-lab commented 6 years ago

読み込まれているjQueryのバージョンを確認する

$.fn.jquery
"1.12.4"

1.12.4系が使えるっぽい。

合計値を計算

Chrome開発者ツールのConsoleタブに計算式をコピペする。

var eSum = 0, aSum = 0;
$('tr:not(.js-child-issue-row) > .cell-estimated-hours').each(function(){eSum += +$(this).text()});
$('tr:not(.js-child-issue-row) > .cell-actual-hours').each(function(){aSum += +$(this).text()});
'予定時間: ' + eSum + ' 実績時間: ' + aSum

合計値を計算(子課題を含む)

Chrome開発者ツールのConsoleタブに計算式をコピペする。

var eSum = 0, aSum = 0;
$('.cell-estimated-hours').each(function(){eSum += +$(this).text()});
$('.cell-actual-hours').each(function(){aSum += +$(this).text()});
'予定時間: ' + eSum + ' 実績時間: ' + aSum
ucan-lab commented 6 years ago

ワンライナー

合計値を計算

var eSum = 0, aSum = 0;$('tr:not(.js-child-issue-row) > .cell-estimated-hours').each(function(){eSum += +$(this).text()});$('tr:not(.js-child-issue-row) > .cell-actual-hours').each(function(){aSum += +$(this).text()});'予定時間: ' + eSum + ' 実績時間: ' + aSum

合計値を計算(子課題を含む)

var eSum = 0, aSum = 0;$('.cell-estimated-hours').each(function(){eSum += +$(this).text()});$('.cell-actual-hours').each(function(){aSum += +$(this).text()});'予定時間: ' + eSum + ' 実績時間: ' + aSum