Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save infuerno/6325619682b44c46ed1ba80137e17d33 to your computer and use it in GitHub Desktop.
Save infuerno/6325619682b44c46ed1ba80137e17d33 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Rollup subtask estimates
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://infuerno.atlassian.net/secure/RapidBoard.jspa?*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
$(document).ready(function () {
$('.ghx-issue-content').each(function() {
let estimate = $(this).find('span.ghx-extra-field-content').text();
let hoursAndMins = estimate.split(', ');
let shortHoursAndMins = '-';
for(let i = 0; i < hoursAndMins.length; i++) {
let s = /(\d+ (h|m))\S+/.exec(hoursAndMins[i]);
if (s) {
shortHoursAndMins = shortHoursAndMins.replace('-', '') + s[1].replace(' ', '') + ' ';
}
}
shortHoursAndMins = shortHoursAndMins.trim();
$(this).find('span.ghx-statistic-badge').text(shortHoursAndMins);
$(this).find('div.ghx-plan-extra-fields').hide();
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment