Rally API:投资组合项目的文档列表?

我通过Ruby使用Rally API( http://developer.help.rallydev.com/ruby-toolkit-rally-rest-api-json )。 我想查询Portfolio项目的属性(字段?)。 我有工作代码,例如这可以正常工作(虽然它似乎显示名称,而不是ID – 我期待的东西像’T30’,但这显示’这是我的倡议的名称’):

pi_query.order = "FormattedID Asc" 

通过反复试验,我也看到了

 pi_query.order = "Name Asc" 

也有效。 我的问题:我可以在这里使用什么价值观? 我找了几个小时。 名称,FormattedID和描述工作; 家长没有。 我找不到参考文档。

(我正在尝试编写一个自定义报告,显示项目组合项目是一种更易读的方式 – 以我可以打印的某种嵌套方式显示的主题,主动性和function.Rally中的Portfolio Hierarchy应用程序不会提供一个可打印的视图,所以我希望为它编写一个快速脚本。我不需要太多,主要是名称,以及这个东西是主题,主动性还是function。这样的东西:)

 T30 My first theme I65 The first initiative F44 The first feature under that F45 Another feature I66 Another initiative T31 My second theme I67 Yet another initiative 

我找到了。 以下是文档的正确链接:

https://rally1.rallydev.com/slm/doc/webservice/

如果单击左侧的“ AllowedAttributeValue ”,您将获得一个属性列表。 按Ctrl-F并搜索“投资组合”。 当您进入标题为“投资组合项目(非创建类型)”的主标题时,会出现“获取完整对象”和“美化JSON输出”的复选框。 检查两者,然后点击下面的“查询”按钮。 您将在新窗口中获得对象模型。

在这个新窗口中,您可以看到所有有效属性。 例如,搜索“Parent”,您可以看到Parent哈希的有效值。 其中一个键是_refObjectName,它为您提供父节点的名称。

这是一个工作示例,它查询计划并显示其名称及其父级名称。

 require 'rally_api' config = {:base_url => "https://rally1.rallydev.com/slm"} config[:username] = "REPLACE" config[:password] = "REPLACE" config[:workspace] = "REPLACE" config[:project] = "REPLACE" @rally = RallyAPI::RallyRestJson.new(config) pi_query = RallyAPI::RallyQuery.new() pi_query.type = "portfolioitem/initiative" pi_query.fetch = "Name,FormattedID,Description,PortfolioItemTypeName,Parent" pi_query.project_scope_up = true pi_query.project_scope_down = true pi_query.order = "FormattedID Asc" pi_results = @rally.find(pi_query) pi_results.each do |result| parent_name = (result.Parent == nil)? "" : "has parent \"" + result.Parent["_refObjectName"] + "\"" puts result.FormattedID + " " + result.Name + " " + parent_name end 

这是一个更完整的版本,它以缩进输出的forms显示主题,主动性和function。 可能有一种更有效的输出方法,但这种方法确实可以针对我的项目生成正确的输出。

 require 'rally_api' config = {:base_url => "https://rally1.rallydev.com/slm"} config[:username] = "REPLACE" config[:password] = "REPLACE" config[:workspace] = "REPLACE" config[:project] = "REPLACE" @rally = RallyAPI::RallyRestJson.new(config) pi_query = RallyAPI::RallyQuery.new() pi_query.project_scope_up = false pi_query.project_scope_down = true pi_query.order = "FormattedID Asc" # Themes pi_query.type = "portfolioitem/theme" pi_query.fetch = "Name,FormattedID" pi_results = @rally.find(pi_query) themes = [] pi_results.each { |theme| themes << [ theme.FormattedID, theme.Name ] } # Initiatives pi_query.type = "portfolioitem/initiative" pi_query.fetch = "Name,FormattedID,Parent" pi_results = @rally.find(pi_query) initiatives = [] pi_results.each do |initiative| parent_name = (initiative.Parent == nil)? "" : initiative.Parent["_refObjectName"] initiatives << [ initiative.FormattedID, initiative.Name, parent_name] end # Features pi_query.type = "portfolioitem/feature" pi_query.fetch = "Name,FormattedID,Parent" pi_results = @rally.find(pi_query) features = [] pi_results.each do |feature| parent_name = (feature.Parent == nil)? "" : feature.Parent["_refObjectName"] features << [ feature.FormattedID, feature.Name, parent_name] end # Output themes.each do |theme| puts theme[0] + " " + theme[1] initiatives.each do |initiative| if (initiative[2] == theme[1]) puts " " + initiative[0] + " " + initiative[1] features.each do |feature| if (feature[2] == initiative[1]) puts " " + feature[0] + " " + feature[1] end end end end end