Created
October 13, 2011 15:10
-
-
Save martindrapeau/1284460 to your computer and use it in GitHub Desktop.
Planbox Burndown Data in Current Iteration
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
var iteration; | |
function doWork() { | |
var burndown = iteration.burndown; | |
var product_data = burndown.data[0]; | |
var dates = burndown.dates; | |
console.log('Points remaining in iteration'); | |
for (var i=0; i<dates.length; i++) { | |
var remain = product_data.points[i]; | |
if (remain != null) { | |
console.log(dates[i]+': '+remain+' points'); | |
} else { | |
console.log(dates[i]+': no data'); | |
} | |
} | |
} | |
// Pull data from Planbox and then call our function | |
// to summarize... | |
$.post('https://www.planbox.com/api/get_iterations', | |
{product_id:1234, timeframe:'current'}, | |
function(data) { | |
iteration = data.content[0]; | |
doWork(); | |
}, | |
'json' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fetches the points burndown data for the Current iteration.
Does so by fetching all stories in the Current iteration.
Once data is loaded from Planbox, the
doWork
function is called.It writes to the console the number of points remaining for each day of the iteration.
If there is no data logged (i.e. the date is in the future), it prints out
no data
.