Skip to content

Instantly share code, notes, and snippets.

@tjarratt
Created May 2, 2014 18:17
Show Gist options
  • Select an option

  • Save tjarratt/b09915277359bf02ccb4 to your computer and use it in GitHub Desktop.

Select an option

Save tjarratt/b09915277359bf02ccb4 to your computer and use it in GitHub Desktop.
attach tasks from file to pivotal tracker story
#!/usr/bin/env ruby
require 'pivotal-tracker'
PivotalTracker::Client.token = ENV['TRACKER_TOKEN']
PivotalTracker::Client.use_ssl = true
if ARGV.length != 4
puts <<-USAGE
usage: attach-tasks-to-story $PROJECT_ID $STORY_ID $TASKS_FILE
USAGE
end
puts ARGV.inspect
project = PivotalTracker::Project.find(ARGV[1].to_i)
story = project.stories.find(ARGV[2].to_i)
File.read(ARGV[3].to_s).split("\n").each do |line|
story.tasks.create(:description => line)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment