May 22nd, 2010

Create Printable PDF Cards from Your Pivotal Tracker Stories

If there’s a better project management tool for Agile workflow then Pivotal Tracker I have yet to find it. If you haven’t already, do check it out for user story management and reporting.

That’s why I was shocked to discover that it does not provide any sort of printable output. You just cannot print the cards. I have never noticed, not having the need on smaller projects.

So the shock came when we have put in bunch of stories for a project redesign on my current contract. The whole point of punching the stories in the system is having a conversation about them at the table, without crouching over a notebook.

Hopefully I’ve remembered a tool by Bryan Helmkamp, features2cards, for converting Cucumber scenarios to PDF printable cards — almost exactly just what we needed. Some twenty minutes later I had a really basic version — adapted from brynary’s code — ready, so we could start the planning poker game all of us was looking forward to. You just gotta love Ruby.

Due to my usual inability to leave everything in a “good enough” state, I’ve polished the quickly whipped-up script a bit to something which makes more sense, and provides more useful output:

Sample PDF output of Pivotal Tracker user stories

Now you can use a paper cutter or scissors to have a nice stack of cards for your planning session. The Ruby code is deliberately non-clever and procedural, so you should have no trouble to adapt it for your needs. The PDF itself is generated with Prawn library.

If you use Pivotal Tracker, you may well find the script useful, download it from the following Gist: http://gist.github.com/405984#file_pivotal_csv_to_pdf_cards.rb or clone it with Git:

git clone git://gist.github.com/405984.git pivotal_pdf_cards

The script takes the CSV file exported from Pivotal Tracker as an argument and exports a PDF file named after that in the same folder.

Actually, thanks to the Pivotal Tracker API you can export a CSV from a sample public project (which I use in my university lectures to teach about agile process and project specification) to check it out. The stories are in Czech, but you don’t have to understand their content to figure out what’s what.

First, install all the required gems:

gem install fastercsv term-ansicolor prawn

And then run this:

curl --silent -X POST 'http://www.pivotaltracker.com/projects/74202/export' \
--data 'options[include_icebox_stories]=1' > pivotal_test.csv
ruby pivotal_csv_to_pdf_cards.rb pivotal_test.csv
open pivotal_test.pdf   # If you're on a Mac...

As a side note, it’s interesting how Prawn is both awesome and awful way how to generate PDF. Software really is hard.

blog comments powered by Disqus