Last active
December 27, 2015 01:59
-
-
Save andy-berry-dev/7249376 to your computer and use it in GitHub Desktop.
Javascript bookmarklet to calculate sprint sizings for issues on GitHub. Assumes sizes are defined by labels in the format 'size <size>'
This file contains hidden or 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
javascript:(function(){ | |
var sizeStringPrefix = "size ", | |
size = 0; | |
milestoneTitle = ""; | |
jQuery(".issue-milestone .css-truncate-target").each(function() { | |
var thisMilestone = $(this).text().trim(); | |
if (milestoneTitle.indexOf(thisMilestone) == -1) { | |
milestoneTitle += " " + thisMilestone; | |
} | |
}); | |
milestoneTitle.trim(); | |
jQuery(".labels a[aria-label^='View all "+sizeStringPrefix+"']").each(function() { | |
var data = $(this).text(); | |
var thisSize = data.substring(sizeStringPrefix.length); | |
size += parseFloat(thisSize); | |
}); | |
var paginationSize = jQuery(".pagination a").length; | |
var paginationWarning = (paginationSize > 0) ? "WARNING: There is more than 1 page, the sprint size is probably too big.\n\n" : ""; | |
alert(paginationWarning+"total sizing for " + milestoneTitle + " is: " + size); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment