Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Pequenos ajustes #2

Merged
merged 2 commits into from

2 participants

@alxpborges

Incluindo no addtask:

  • Suporte para ruby < 1.9.3
  • Adicionar Tasks em Lote
  • Possibilidade de adicionar Defeitos
@eduardomacan eduardomacan merged commit 1edea36 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 11, 2012
  1. Suporte para ruby < 1.9.3

    Alexander Borges authored
  2. Possibilidade de adicionar tasks em lote e suporte para adicionar def…

    Alexander Borges authored
    …eitos
This page is out of date. Refresh to see the latest.
Showing with 22 additions and 10 deletions.
  1. +22 −10 addtask
View
32 addtask
@@ -1,5 +1,7 @@
#!/usr/bin/env ruby
+require "rubygems"
require 'rally_rest_api'
+require 'yaml'
begin
config = YAML.load_file("#{Dir.home}/.rallyutils")
@@ -7,22 +9,32 @@ rescue
puts "\nERROR: #{Dir.home}/.rallyutils not found"
end
-
rally_user=config["user"]
rally_pass=config["pass"]
-puts "Enter Task Name"
-task_name = STDIN.gets.chop
-user_story = ARGV[0]
-puts "Creating task '#{task_name}' in story #{user_story}"
-
rally = RallyRestAPI.new(:username => rally_user,
:password => rally_pass)
-stories = rally.find( :hierarchical_requirement ) {
+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
-task = rally.create(:task, :name => task_name , :work_product => story, :estimate => 1, :to_do => 1)
-puts "Task #{task.formatted_i_d} created"
+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
Something went wrong with that request. Please try again.