Created
May 2, 2014 18:17
-
-
Save tjarratt/b09915277359bf02ccb4 to your computer and use it in GitHub Desktop.
attach tasks from file to pivotal tracker story
This file contains hidden or 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 | |
| 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