Skip to content

Instantly share code, notes, and snippets.

@Naatan
Last active December 18, 2015 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Naatan/5770489 to your computer and use it in GitHub Desktop.
Save Naatan/5770489 to your computer and use it in GitHub Desktop.
YouTrack show estimation totals on agile board (userscript)
// ==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