1

クエリでプロジェクト名と一致させようとしています。また、各機能レコードに関連付けられているプロジェクトの名前を出力しようとしています。たくさんの答えがあることは知っていますが、私を助けるものは何も見つかりませんでした。私はこのようなことをしようとしています:

pi_query.type = "portfolioitem"      
pi_query.fetch="Name,FormattedID,Owner,c_ScopingTeam,c_AspirationalRelease,c_AssignedProgram,Tags"

#To be configured as per requirement
pi_query.project_scope_up = false
pi_query.project_scope_down = false
pi_query.order = "FormattedID Asc"


pi_query.query_string = "(Project.Name = \"Uni - Serviceability\")"
pi_results = @rally.find(pi_query)

プロジェクト名を一致させようとしていますが、うまくいきません。プロジェクトの名前も印刷しようとしました。Project.Name、Project.Values、または単に Project を試しました。しかし、うまくいきません。「portfolioItem」であるクエリタイプが原因であると推測していますが、他のすべての属性値を正しく取得しているため、タイプを変更できません。ありがとう。

4

1 に答える 1

0

Make sure to fetch Project, e.g: feature_query.fetch = "Name,FormattedID,Project"

and this should work:

feature_query.query_string = "(Project.Name = \"My Project\")"

Here is an example where a feature is found by project name.

require 'rally_api'

#Setup custom app information
headers = RallyAPI::CustomHttpHeader.new()
headers.name = "create story in one project, add it to a feature from another project"
headers.vendor = "Nick M RallyLab"
headers.version = "1.0"

# Connection to Rally
config = {:base_url => "https://rally1.rallydev.com/slm"}
config[:username] = "user@co.com"
config[:password] = "secret"
config[:workspace] = "W"
config[:project] = "Product1"
config[:headers] = headers #from RallyAPI::CustomHttpHeader.new()

@rally = RallyAPI::RallyRestJson.new(config)

obj = {}
obj["Name"] = "new story xyz123"
new_s = @rally.create("hierarchicalrequirement", obj)

query = RallyAPI::RallyQuery.new()
query.type = "portfolioitem"
query.fetch = "Name,FormattedID,Project"
query.workspace = {"_ref" => "https://rally1.rallydev.com/slm/webservice/v2.0/workspace/12352608129" } 
query.query_string = "(Project.Name = \"Team Group 1\")"

result = @rally.find(query)
feature = result.first

puts feature

field_updates={"PortfolioItem" => feature}
new_s.update(field_updates)
于 2013-09-20T15:55:06.857 に答える