Last active
August 29, 2015 14:22
-
-
Save borkweb/b2444a27ce31b1f3c717 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
// Calculate hours for any type of ticket in the next release | |
(function( $ ) { | |
var total = 0; | |
$('.estimated_hours').each(function() { | |
var $el = $( this ); | |
var $row = $el.closest( 'tr' ); | |
var $version = $row.find( '.fixed_version a' ); | |
if ( 'Next Release' !== $.trim( $version.html() ) ) return; | |
var val = $.trim( $( this ).text() ); | |
if ( ! val ) return; | |
total += parseFloat( val ); | |
}); | |
console.log( 'Hours estimated: ' + total ); | |
})( jQuery ); | |
// calculate hours for next release that aren't pending code review, smoketest, qa, or release | |
(function( $ ) { | |
var total = 0; | |
$('.estimated_hours').each(function() { | |
var $el = $( this ); | |
var $row = $el.closest( 'tr' ); | |
var $version = $row.find( '.fixed_version a' ); | |
var $status = $row.find( '.status' ); | |
var status = $.trim( $status.html() ); | |
if ( 'Next Release' !== $.trim( $version.html() ) ) return; | |
if ( | |
'Pending Code Review' === status | |
|| 'Pending QA' === status | |
|| 'Pending Smoketest' === status | |
|| 'Pending Release' === status | |
) { | |
return; | |
} | |
var val = $.trim( $( this ).text() ); | |
if ( ! val ) return; | |
total += parseFloat( val ); | |
}); | |
console.log( 'Hours estimated: ' + total ); | |
})( jQuery ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment