Last active
October 10, 2015 19:17
-
-
Save robworley/3737915 to your computer and use it in GitHub Desktop.
export_pt_label
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Usage:
export_pt_label YOUR_LABEL
Niiice. thx
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
Prior to use:
Update the API_TOKEN and PROJECT_ID constants.
Usage: export_pt_label