【发布时间】:2014-08-25 03:27:48
【问题描述】:
我在通过 powershell 创建 TFS 任务时尝试添加父链接。但是,我只能添加一个相关链接:
function Create-New-WorkItem($projName, $taskType, $title, $state, $assignedTo, $iterationPath, $activity, $BLItem)
{
$tfs = Get-TfsServer
$ws = $tfs.GetService([type]"Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore")
$proj = $ws.projects[$projName]
$workitem = $proj.workitemtypes[$taskType].newworkitem()
$workitem.open()
$workitem.title = $title
$workitem.state = $state
$workitem.fields["Assigned To"].value = $assignedTo
$workitem.iterationpath = $iterationPath
$workitem.fields["Activity"].value = $activity
$id = Get-Parent-Link $BLItem
$workitem.links.add($id.ID)
$workitem.close()
$workitem.save()
}
function Get-Parent-Link($backLogItemName)
{
$tfs = Get-TfsServer
$WIQL = @"
SELECT [System.Id]
FROM WorkItems
where [System.Title] = '$backLogItemName'
"@
return $tfs.wit.query($WIQL)
}
如何将链接添加为父链接而不是相关链接?
【问题讨论】:
标签: powershell tfs azure-devops