Permalink
Browse files

Adding a search, and fixing minor tag related issue.

  • Loading branch information...
1 parent d951fd5 commit 0dc4f7be25d9b1fe8214a7358aa6824059697821 @jkamenik committed Feb 10, 2011
Showing with 45 additions and 1 deletion.
  1. +2 −1 common.rb
  2. +43 −0 search_de.rb
View
3 common.rb
@@ -42,7 +42,8 @@ def escape(string)
end
def std_tags(obj,prefix='',postfix="\n")
- "#{prefix}#{obj.tags.join(', ')}#{postfix}" if obj.tags.size > 0
+ "#{prefix}#{obj.tags.join(', ')}#{postfix}" if obj.tags && obj.tags.size > 0
+ ''
end
def std_rank(obj)
View
43 search_de.rb
@@ -0,0 +1,43 @@
+#!/usr/local/bin/ruby
+require 'rubygems'
+require 'rally_rest_api'
+require 'date'
+require File.dirname(__FILE__)+"/common"
+
+config = Common.load_config
+
+rally = RallyRestAPI.new(
+ :username => config[:username],
+ :password => config[:password]
+)
+
+terms = ["custom","field"]
+
+class QueryResult
+ def query_string
+ @query_string
+ end
+end
+
+des = rally.find(:defect, :order => [:formatted_i_d]){
+ _or_ do
+ _and_ do
+ terms.each do |term|
+ contains :description, term
+ end
+ end
+ _and_ do
+ terms.each do |term|
+ contains :name, term
+ end
+ end
+ end
+
+ _or_ do
+ lt :schedule_state, 'Completed'
+ lt :state, 'Resolved'
+ end
+}
+des.each do |de|
+ puts Common.render :de, de
+end

0 comments on commit 0dc4f7b

Please sign in to comment.