Skip to content

Instantly share code, notes, and snippets.

@ayan4m1
Created December 7, 2018 20:23
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 ayan4m1/46dfb590afa71f807a72fc89d216060b to your computer and use it in GitHub Desktop.
Save ayan4m1/46dfb590afa71f807a72fc89d216060b to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Average allocation in Rally
// @namespace https://rally1.rallydev.com/
// @version 0.1
// @description Find the average allocation from the Team Status page of Rally
// @author ayan4m1 <andrew@bulletlogic.com>
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @require https://gist.githubusercontent.com/BrockA/2625891/raw/waitForKeyElements.js
// @match https://rally1.rallydev.com/
// @grant none
// ==/UserScript==
(function() {
let executed = false;
waitForKeyElements('#teamstatus_tps', execute);
function execute() {
if (executed) {
return;
}
executed = true;
let total = 0;
let count = 0;
$('div[title="Individual Load"]').each(function (i, v) {
total += parseInt($(v).text().replace('%', ''));
count++;
});
$('#teamstatus_tps > tbody')
.append('<tr class="group"><td colspan="6" style="text-align:right">Average Allocation</td><td style="text-align:center">' + Math.round(total / count) + '%</td><td colspan="6">&nbsp;</td></tr>');
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment