【发布时间】:2016-12-09 16:19:17
【问题描述】:
我的团队正计划使用 TFS 作为我们的 ALM 工具。我们正在评估本地和托管选项。 TFS 实施的要求之一是能够与我们的本地票务系统 Microsoft SCSM 集成。我找到了几种方法来执行与本地 TFS 的集成。但是,就托管选项(VS Team Services)而言,我无法找到任何信息。本地 SCSM 与 VS Team Services 的集成是否可行?提前致谢!
【问题讨论】:
标签: azure-devops
我的团队正计划使用 TFS 作为我们的 ALM 工具。我们正在评估本地和托管选项。 TFS 实施的要求之一是能够与我们的本地票务系统 Microsoft SCSM 集成。我找到了几种方法来执行与本地 TFS 的集成。但是,就托管选项(VS Team Services)而言,我无法找到任何信息。本地 SCSM 与 VS Team Services 的集成是否可行?提前致谢!
【问题讨论】:
标签: azure-devops
SCSM 可以通过 API 和 PowerShell(例如REST API)与 Visual Studio Team Services 集成,这类似于与 TFS 集成。
步骤:
代码:
#Load TFS PowerShell Snap-in
if ((Get-PSSnapIn -Name Microsoft.TeamFoundation.PowerShell -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin Microsoft.TeamFoundation.PowerShell
}
$Tfs2015AssembliesPath="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer"
Add-Type -Path "$Tfs2015AssembliesPath\Microsoft.TeamFoundation.Client.dll"
Add-Type -Path "$Tfs2015AssembliesPath\Microsoft.TeamFoundation.Common.dll"
Add-Type -Path "$Tfs2015AssembliesPath\Microsoft.TeamFoundation.Build.Client.dll"
Add-Type -Path "$Tfs2015AssembliesPath\Microsoft.TeamFoundation.Build.Common.dll"
Add-Type -Path "$Tfs2015AssembliesPath\Microsoft.TeamFoundation.Git.Client.dll"
Add-Type -Path "$Tfs2015AssembliesPath\Microsoft.TeamFoundation.SourceControl.WebApi.dll"
#Add-Type -Path "$Tfs2015AssembliesPath\Microsoft.TeamFoundation.TestManagement.Client.dll"
Add-Type -Path "$Tfs2015AssembliesPath\Microsoft.TeamFoundation.VersionControl.Client.dll"
Add-Type -Path "$Tfs2015AssembliesPath\Microsoft.TeamFoundation.WorkItemTracking.Client.dll"
#TFS Server Collection
[string] $tfsCollectionUrl = "[collection url]"
#Get Team Project Collection
$teamProjectCollection = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($tfsCollectionUrl)
#Get Work Item Store object
$ws = $teamProjectCollection.GetService([type]"Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore")
#Get Team Project
$proj = $ws.Projects["project name"]
#Get the Work Item Type to create
$wit = $proj.WorkItemTypes["Task"]
#Create a new work item of that type
$workitem = $wit.NewWorkItem()
#Set work item properties
$workItem.Title = "title"
$workItem.Description = "des"
$workitem.AreaPath = "XXX"
$workitem.IterationPath = "XXX"
#Save work item
$workItem.Save()
【讨论】: