Search code examples
rubyrubygemspivotaltracker

Using Pivotal Tracker API to get all stories in Backlog or Current?


I am using the pivotal-tracker gem: https://github.com/jsmestad/pivotal-tracker.

As a result, I'm easily able to stories by state, e.g.

project.stories.all(:current_state => 'started')

However, I'm wondering how to get all stories that correspond to the Backlog and/or Current columns.

It looks like this may have something to do with iterations but I can't figure that out.

project.iterations.find(????)

Any help would be greatly appreciated! For now I'm just separating out based on story state.


Solution

  • Figured this out thanks to someone from Pivotal who pointed me to these code snippets: https://github.com/jsmestad/pivotal-tracker/blob/master/spec/pivotal-tracker/iteration_spec.rb

    For example, to grab the current list:

    @iteration = PivotalTracker::Iteration.current(@project)