ruby - RallyRestToolkitForRuby - project_scope_up & project_scope_down 似乎不起作用

标签 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)

提前致谢。

最佳答案

在上面的示例中,您似乎没有为范围界定设置项目 - 确保您有一行设置 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/

相关文章:

ruby - Ruby 1.8.7 中的 NoMethodError

java - 尝试使用 Rally Java 工具包更新用户故事时出现 "Could not update: Could not write changes in Unit Of Work"错误

checkbox - Rally SDK 2.00 p2 添加几个复选框

javascript - 逐步使用 Node.js 创建自定义应用程序

ruby - block 定义 - 大括号和 do-end 之间的区别?

ruby-on-rails - 请求规范中的 stub 身份验证

c# - 优化代码(就像在 ruby​​ 中所做的那样),用于在 C# 中交换奇数位置的 2 个数字

ruby-on-rails - 如何在错误 rails "warning: 299 Elasticsearch built-in security features are not enabled. Without authentication, your cluster could..."中修复此问题

rally - 查询以获取我曾经在 Rally 中处理过的所有用户故事的列表

c# - 在 Rally .Net API : How to use Query. 运算符中。包含数组或列表(或条件)