我正在尝试使用 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)
提前致谢。
最佳答案
在上面的示例中,您似乎没有为范围界定设置项目 - 确保您有一行设置 query.project = 类似于: query.project = {"_ref"=> "https://rally1.rallydev.com/slm/webservice/1.25/project/12345.js "}
或者如果您将项目对象存储在变量中: myproject = @rally.find_project(workspace, "项目名称") query.project = 我的项目
希望对您有所帮助。
关于ruby - RallyRestToolkitForRuby - project_scope_up & project_scope_down 似乎不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15105486/