RallyRestToolkitForRuby - project_scope_up& project_scope_down似乎不起作用

时间:2013-02-27 06:21:13

标签: ruby rally

我正在尝试使用RallyRestToolkitForRuby查询项目及其子项中的所有故事。我正在尝试使用下面的代码片段,project_scope_up和project_scope_down似乎对结果没有影响,包含了指定树之外的项目的结果。这里有什么不对?

config = {:base_url => "https://rally1.rallydev.com/slm"}
config[:username]   = "xxxxxxxxxx"
config[:password]   = "xxxxxxxxx"
config[:workspace]  = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
config[:project]    = "xxxxxxxxx"
config[:headers]    = headers 
RallyAPI::RallyRestJson.new(config)
startdate = DateTime.parse "2013-02-20T00:00:00.000"
enddate = DateTime.parse "2013-02-23T00:00:00.000"
query = RallyAPI::RallyQuery.new()
query.type = "hierarchicalrequirement"
query.fetch = "Iteration,Capitalizeable,CapBucket,FormattedID,DirectChildrenCount,RevisionHistory,Revisions"
query.page_size = 20       #optional - default is 200
query.limit = 20          #optional - default is 99999
query.project_scope_up = false
query.project_scope_down= true
query.query_string = "((LastUpdateDate > \"#{startdate.to_s}\") AND (LastUpdateDate < \"#{enddate.to_s}\"))"
results = @rally.find(query)

先谢谢。

1 个答案:

答案 0 :(得分:1)

在上面的示例中,您似乎没有为作用域设置项目 - 确保您有一个行设置query.project =类似于: query.project = {“_ ref”=&gt; “https://rally1.rallydev.com/slm/webservice/1.25/project/12345.js”}

或者如果项目对象存储在变量中: myproject = @ rally.find_project(工作区,“项目名称”) query.project = myproject

希望有所帮助。