Skip to content

Instantly share code, notes, and snippets.

@jdoconnor
Created July 1, 2014 15:03
Show Gist options
  • Select an option

  • Save jdoconnor/9628b6340a6fa1bbc6f2 to your computer and use it in GitHub Desktop.

Select an option

Save jdoconnor/9628b6340a6fa1bbc6f2 to your computer and use it in GitHub Desktop.

Revisions

  1. Jay OConnor created this gist Jul 1, 2014.
    19 changes: 19 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    # gem install pivotal-tracker
    require 'pivotal-tracker'

    PivotalTracker::Client.token = 'YOUR API TOKEN' # Manually set API Token
    a_project = PivotalTracker::Project.find(YOUR PROJECT NUMBER)
    iterations = PivotalTracker::Iteration.current_backlog(a_project)
    stories = iterations.collect{ |i| i.stories }.flatten

    output = ""
    stories.each do |story|
    next if story.current_state == 'accepted'
    github_link = story.description.match /(https.*github.*\.com.+)/

    output << "+ [#{story.name}](#{story.url})"
    output << "(#{story.labels})" unless story.labels.nil? || story.labels == ''
    output << " -- [github issue](#{github_link})" if github_link
    output << "\n"
    end
    puts output