0

だから私はRallyを使ってこのクエリを持っています:

query_result = stuff.slm.find(:hierarchical_requirement, :project => project, :workspace => stuff.workspace, :project_scope_up => false, :project_scope_down => true){ equal :name, parent_name.strip }

そして、私はそうします、

parent = query_result.results.first

親に割り当てられているオブジェクトの種類を知りたいです。私は Rally の例外リストに載っていないため、スクリプトを実行できません。しかし、私はこのスクリプトの SSO 統合を作成しており、いくつかの問題があります。関数がこの「親」を返すため、「親」を調べれば問題は解決すると思います。誰かがこれに関する情報を持っている場合は、共有してください。ありがとう!

4

1 に答える 1

0

ストーリー (HierarchicalRequirement) オブジェクトが割り当てられます。Rally Ruby REST ツールキットの使用

以下のコードは次のように表示されます。

my_story: abc, FormattedID: US86, _ref:https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement/12891971030

.

@rally = RallyAPI::RallyRestJson.new(config)
some_name = "abc"
query = RallyAPI::RallyQuery.new()
query.type = :story
query.fetch = "FormattedID"
query.query_string = "(Name = \"#{some_name}\")"
results = @rally.find(query)

my_story = results.first
puts "my_story: #{my_story}, FormattedID: #{my_story["FormattedID"]}, _ref:#{my_story["_ref"]}"

コード内で FormattedID に基づいてユーザー ストーリーを見つけようとする場合の例を次に示します。ストーリーの親はストーリーであるため、それが親であるかどうかは問題ではありません。わかりやすくするために、スクリプトでは「親」の代わりに「ストーリー」を使用しました。この例では、FormattedID がコマンド ライン引数として入力されます。story = result.firstではなくを使用していることに注意してくださいstory=result。出力のスクリーンショットを次に示します。

ここに画像の説明を入力

require 'rally_api'

#Setup custom app information
headers = RallyAPI::CustomHttpHeader.new()
headers.name = "find story"
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] = "X"
config[:project] = "Y"
config[:version] = "v2.0"
config[:headers] = headers #from RallyAPI::CustomHttpHeader.new()

unless ARGV.length == 1
  puts "enter one argument, e.g. US123, with no spaces"
  exit
end

story = nil
story_id = ARGV[0]
puts "find story by FormattedID: #{story_id}"

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

query = RallyAPI::RallyQuery.new()
query.type = :story
query.fetch = "Name,FormattedID,ScheduleState"
query.workspace = {"_ref" => "https://rally1.rallydev.com/slm/webservice/v2.0/workspace/1111.js" } 
query.project = {"_ref" => "https://rally1.rallydev.com/slm/webservice/v2.0/project/2222.js" } 
query.project_scope_up = true
query.project_scope_down = true

query.query_string = "(FormattedID = \"#{story_id}\")"  

result = @rally.find(query)

if(result.length > 0)
    puts "found the story"
    story = result.first
    puts "FormattedID: #{story["FormattedID"]}, Name: #{story["Name"]}, ScheduleState: #{story["ScheduleState"]}"
else
   puts "did not find a story with FormattedID #{story_id}" 
end 
puts story.class
puts story.inspect
于 2013-10-02T20:14:35.837 に答える