Created
June 19, 2020 19:22
-
-
Save infuerno/6325619682b44c46ed1ba80137e17d33 to your computer and use it in GitHub Desktop.
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 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