Last active
December 18, 2015 10:39
-
-
Save Naatan/5770489 to your computer and use it in GitHub Desktop.
YouTrack show estimation totals on agile board (userscript)
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
// ==UserScript== | |
// @name YouTrack show agile estimation totals | |
// @namespace http:// | |
// @version 0.1 | |
// @match http://*.myjetbrains.com/*/agile/* | |
// ==/UserScript== | |
function run() { | |
$(".sb-column").each(function(index) | |
{ | |
var total = 0; | |
$(this).find(".sb-task-estimate").each(function() | |
{ | |
var estimate = $(this).data("value"); | |
if (estimate.substr(-1) == 'h') | |
{ | |
total += parseInt(estimate.substr(0, estimate.length-1)); | |
} | |
else if (estimate.substr(-1) == 'm') | |
{ | |
total += parseFloat(Number(estimate.substr(0, estimate.length-1) / 60).toFixed(1)); | |
} | |
else if (estimate.substr(-1) == 'd') | |
{ | |
total += parseInt(estimate.substr(0, estimate.length-1) * 8); | |
} | |
}); | |
$(".sb-column-title:eq("+(index)+") .estimate").remove(); | |
$(".sb-column-title:eq("+(index)+")").prepend( | |
"<div class='estimate' style='float: right; font-weight: bold !important;color: grey; font-size: 110%;'>" + | |
(total) + "h</div>" | |
); | |
}); | |
} | |
setInterval(run, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment