Skip to content

Instantly share code, notes, and snippets.

@jdoconnor
Created July 1, 2014 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdoconnor/9628b6340a6fa1bbc6f2 to your computer and use it in GitHub Desktop.
Save jdoconnor/9628b6340a6fa1bbc6f2 to your computer and use it in GitHub Desktop.
pivotal to markdown
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment