rally_api 0.9.20 → 0.9.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,7 +25,7 @@ module RallyAPI
25
25
  # query_hash[:limit] <br>
26
26
 
27
27
  class RallyQuery
28
- attr_accessor :type, :query_string, :fetch, :workspace, :project, :project_scope_up, :project_scope_down
28
+ attr_accessor :type, :query_string, :fetch, :workspace, :project, :project_scope_up, :project_scope_down, :search
29
29
  attr_accessor :order, :page_size, :limit
30
30
 
31
31
  alias :pagesize :page_size
@@ -50,6 +50,7 @@ module RallyAPI
50
50
  query_params[:projectScopeDown] = @project_scope_down
51
51
  query_params[:order] = @order
52
52
  query_params[:pagesize] = @page_size
53
+ query_params[:search] = @search
53
54
 
54
55
  query_params
55
56
  end
@@ -49,10 +49,10 @@ module RallyAPI
49
49
  attr_accessor :rally_url, :rally_user, :rally_password, :rally_workspace_name, :rally_project_name, :wsapi_version,
50
50
  :rally_headers, :rally_default_workspace, :rally_default_project, :low_debug, :proxy_info,
51
51
  :rally_rest_api_compat, :logger, :rally_alias_types
52
- attr_reader :rally_connection
52
+ attr_reader :rally_connection, :custom_fields_for_type
53
53
 
54
54
  def initialize(args)
55
- @rally_alias_types = { "story" => "HierarchicalRequirement", "userstory" => "HierarchicalRequirement" }
55
+ pre_init()
56
56
 
57
57
  @rally_url = args[:base_url] || "https://rally1.rallydev.com/slm"
58
58
  @rally_user = args[:username]
@@ -319,8 +319,8 @@ module RallyAPI
319
319
  end
320
320
 
321
321
  #todo - check support for portfolio item fields
322
- def allowed_values(type, field)
323
- type_def = get_typedef_for(type)
322
+ def allowed_values(type, field, workspace = @rally_default_workspace)
323
+ type_def = get_typedef_for(type, workspace)
324
324
  allowed_vals = {}
325
325
  type_def["Attributes"].each do |attr|
326
326
  next if attr["ElementName"] != field
@@ -333,8 +333,28 @@ module RallyAPI
333
333
  allowed_vals
334
334
  end
335
335
 
336
+ def custom_fields_for(type, workspace = @rally_default_workspace)
337
+ @custom_fields_for_type[workspace.ObjectID] = {} if @custom_fields_for_type[workspace.ObjectID].nil?
338
+ if @custom_fields_for_type[workspace.ObjectID][type].nil?
339
+ @custom_fields_for_type[workspace.ObjectID][type] = {}
340
+ type_def = get_typedef_for(type, workspace)
341
+ type_def["Attributes"].each do |attr|
342
+ next if attr["Custom"].to_s == "false"
343
+ elem_name = attr["ElementName"]
344
+ elem_name = elem_name.slice(2..256) unless @wsapi_version.start_with?("1")
345
+ @custom_fields_for_type[workspace.ObjectID][type][elem_name] = attr["ElementName"]
346
+ end
347
+ end
348
+ return @custom_fields_for_type[workspace.ObjectID][type]
349
+ end
350
+
336
351
  private
337
352
 
353
+ def pre_init()
354
+ @rally_alias_types = { "story" => "HierarchicalRequirement", "userstory" => "HierarchicalRequirement" }
355
+ @custom_fields_for_type = {}
356
+ end
357
+
338
358
  def make_get_url(type)
339
359
  "#{@rally_url}/webservice/#{@wsapi_version}/#{type}.js"
340
360
  end
@@ -4,5 +4,5 @@
4
4
  #of the applicable Subscription Agreement between your company and
5
5
  #Rally Software Development Corp.
6
6
  module RallyAPI
7
- VERSION = "0.9.20"
7
+ VERSION = "0.9.21"
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rally_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.20
4
+ version: 0.9.21
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-29 00:00:00.000000000Z
12
+ date: 2013-08-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httpclient
16
- requirement: &70131431547920 !ruby/object:Gem::Requirement
16
+ requirement: &70276490705820 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.3.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70131431547920
24
+ version_requirements: *70276490705820
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: simplecov
27
- requirement: &70131431547500 !ruby/object:Gem::Requirement
27
+ requirement: &70276490705400 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70131431547500
35
+ version_requirements: *70276490705400
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70131431547040 !ruby/object:Gem::Requirement
38
+ requirement: &70276490734620 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70131431547040
46
+ version_requirements: *70276490734620
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &70131431546620 !ruby/object:Gem::Requirement
49
+ requirement: &70276490734200 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,29 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70131431546620
57
+ version_requirements: *70276490734200
58
+ - !ruby/object:Gem::Dependency
59
+ name: cucumber
60
+ requirement: &70276490733780 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *70276490733780
69
+ - !ruby/object:Gem::Dependency
70
+ name: aruba
71
+ requirement: &70276490733360 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *70276490733360
58
80
  description: API wrapper for Rally's JSON REST web services api
59
81
  email:
60
82
  - dsmith@rallydev.com