Below is sample code to pull various information from Planbox using the API. Examples are written in Javascript and use jQuery's post function.


Current Iteration Time Report

Constructs a time report for the Current iteration for each resource. Does so by fetching all stories in the Current iteration, then all resources on the product. Once data is loaded from Planbox, the doWork function is called. It creates a sum of estimated and logged time (duration) for each resource. In addition it sums estimated and logged time for each story.

This would yield an object like this:

{1: {
name: "Martin Drapeau",
estimate: 60,
duration: 55.7,
stories: {
1234: {estimate:30, duration:30},
5678: {estiamte:30, duration:25.7}
}
}, 2: {
name: "Gerry Boulet",
estimate:50,
duration:66.3,
stories: {
1234: {estimate:20, duration:30},
5678: {estimate:30, duration:36.3}
}
}}


Points Burndown Data in Current Iteration

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.


Velocity for the Current Iteration

Fetches the Current iteration and pulls the velocity records. Prints a summary.

This would print this in your Javascript console:

Your velocity for iteration Nov30-Dec13 averaged on the past 3 iterations:
  Estimate-hours Velocity = 77
  Points Velocity = 29
  Business Value Velocity = 7800

My Stories Across All Products

Planbox typically shows work for a product (initiative) at a time. This sample code fetches all stories a resource across all products. Limits to the Current iteration of each product. Writes out the stories in the console.