Skip to content

Instantly share code, notes, and snippets.

@robworley
Last active October 10, 2015 19:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save robworley/3737915 to your computer and use it in GitHub Desktop.
Save robworley/3737915 to your computer and use it in GitHub Desktop.
export_pt_label
#!/usr/bin/env ruby
gem 'activesupport'
gem 'pivotal-tracker'
require 'active_support/core_ext/string'
require 'pivotal_tracker'
API_TOKEN = "YOUR_API_TOKEN"
PROJECT_ID = "YOUR_PROJECT_ID"
release_label = ARGV.first
if release_label.blank?
puts "Usage: #{$PROGRAM_NAME} label"
exit 1
end
PivotalTracker::Client.token = API_TOKEN
PivotalTracker::Client.use_ssl = true
bridge = PivotalTracker::Project.find(PROJECT_ID)
sorted_stories = bridge.stories.all(:label => release_label, :includedone => true).group_by(&:story_type)
sorted_stories.each do |story_type, stories|
puts title = story_type.titleize.pluralize
puts "=" * title.length
puts
stories.each do |story|
puts "#{story.name} (#{story.owned_by || 'NO OWNER!'})"
puts "\t#{story.url}"
puts
end
end
@robworley
Copy link
Author

Prior to use:

gem install activesupport
gem install pivotal-tracker
chmod +x path_to_script

Update the API_TOKEN and PROJECT_ID constants.

Usage: export_pt_label

@robworley
Copy link
Author

Usage:

export_pt_label YOUR_LABEL

@cfabianski
Copy link

Niiice. thx

@robworley
Copy link
Author

To paste to the OS X clip/pasteboard:

export_pt_label YOUR_LABEL | pbcopy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment