1

在 Rally 中,只需在 UI 中单击几下即可重新设置任务的父级。当许多任务必须重新安排时,一次完成一项是不切实际的。“多重编辑:任务”页面上的下拉菜单允许更改名称、状态、估计、待办事项和所有者,但不允许更改工作产品,即使此列添加到任务摘要页面上的自定义视图。

4

1 回答 1

0

无法在 UI 中将任务批量重新分配给不同的用户故事。这是一个 Ruby 代码,使用Rally Ruby REST takeit 将基于标签的一组任务重新分配给不同的故事。它使用stop_after变量只是为了在批量编辑周围放置一些护栏。

require 'rally_api'

headers = RallyAPI::CustomHttpHeader.new()
headers.name = "bulk action: set workproduct on tasks"
headers.vendor = "Nick M RallyLab"
headers.version = "1.0"


config = {:base_url => "https://rally1.rallydev.com/slm"}
config[:username] = "user@co.com"
config[:password] = "secret"
config[:workspace] = "W"
config[:project] = "P1"
config[:headers] = headers

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

query = RallyAPI::RallyQuery.new()
query.type = :task
query.fetch = "Name,FormattedID,Description,WorkProduct"
query.workspace = {"_ref" => "https://rally1.rallydev.com/slm/webservice/v2.0/workspace/1111" } 
query.project = {"_ref" => "https://rally1.rallydev.com/slm/webservice/v2.0/project/2222" } 
query.page_size = 200 #optional - default is 200
query.limit = 1000 #optional - default is 99999
query.project_scope_up = false
query.project_scope_down = true
query.order = "Name Asc"
query.query_string = "(Tags.Name = tag1)"

story = {"_ref" => "https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement/33333" } 

tasks_results = @rally.find(query)
tasks = [];
stop_after = 10
count = 0

tasks_results.each do |t|
     count +=1
         break if count > stop_after
    puts "Name: #{t["Name"]}, FormattedID: #{t["FormattedID"]}"
    t.read
    tasks << t
end

tasks.each do |t|
    puts "acting on Name: #{t["Name"]}, FormattedID: #{t["FormattedID"]}"
    field_updates = {"WorkProduct" => story}
    t.update(field_updates)
end
于 2013-08-09T16:56:02.280 回答