Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 40 lines (32 sloc) 908 Bytes
#!/usr/bin/env ruby
require "rubygems"
require 'rally_rest_api'
require 'yaml'
begin
config = YAML.load_file("#{Dir.home}/.rallyutils")
rescue
puts "\nERROR: #{Dir.home}/.rallyutils not found"
end
rally_user=config["user"]
rally_pass=config["pass"]
rally = RallyRestAPI.new(:username => rally_user,
:password => rally_pass)
user_story = ARGV[0]
if user_story[0] == "D"
stories = rally.find( :defect ) {
equal :formatted_id , user_story
}
else
stories = rally.find( :hierarchical_requirement ) {
equal :formatted_id , user_story
}
end
story = stories.first
while true
puts "Enter Task Name"
task_name = STDIN.gets.chop
break if task_name.nil? or task_name.empty?
puts "Creating task '#{task_name}' in story #{user_story}"
task = rally.create(:task, :name => task_name , :work_product => story, :estimate => 1, :to_do => 1)
puts "Task #{task.formatted_i_d} created"
end