我的团队正在计划使用TFS作为我们的ALM工具。我们正在评估内部部署和托管选项。 TFS实施的一个要求是能够与我们的内部部署票务系统Microsoft SCSM集成。我发现了几种与内部部署TFS集成的方法。但是,就托管选项(VS Team Services)而言,我还没能找到任何信息。是否可以将内部部署SCSM与VS Team Services集成?提前谢谢!
答案 0 :(得分:0)
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()