2

我正在尝试使用 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)

提前致谢。

4

1 回答 1

1

在上面的示例中,您似乎没有为范围设置项目 - 确保您有一个行设置 query.project = 类似:query.project = {"_ref" => " https:// rally1.rallydev.com/slm/webservice/1.25/project/12345.js “}

或者如果您将项目对象存储在变量中: myproject = @rally.find_project(workspace, "Project Name") query.project = myproject

希望有帮助。

于 2013-02-28T16:30:13.860 回答