如何将现有区域添加到现有团队? [英] How to add an existing Area to an existing Team?
问题描述
我有一个使用SDK创建的区域,并且有一个团队.如何使用SDK将该区域添加到团队中?
使用 WorkHttpClient.PostTeamIterationAsync()
方法(下面的代码)进行迭代非常简单,但是没有相应的方法可对Area执行相同的操作.
我简要查看了该方法的源代码,但是它包含一个 GUID
,指示目标位置(迭代).如果可以避免的话,我不愿意冒险将其修改为自己用于Areas的水平.当然,有更高的方法可以做到这一点.
根据此问题与解答,可以通过REST API完成此操作,但我使用的是SDK.然后有一个此,但是那里的答案似乎是使用过时的版本.最新的稳定版本中没有可用的引用的类./p>
可以做到吗?
私有函数AddSprintToTeam(Sprint As Classifications.Iteration)作为TeamSettingsIterationDim oContext作为TeamContextDim oSprint作为TeamSettingsIteration昏暗的团队作为列表(属于WebApiTeam)Dim oTeam作为WebApiTeam使用oTeamClient作为TeamHttpClient = Utils.Connection.GetClient(Of TeamHttpClient)使用oWorkClient作为WorkHttpClient = Utils.Connection.GetClient(Of WorkHttpClient)oTeams = oTeamClient.GetTeamsAsync(ProjectName).ResultoTeam = oTeams.Single(函数(团队)Team.Name.StartsWith(项目名称))oContext =新的TeamContext(ProjectName,oTeam.Name)oSprint =带有{.Id = Sprint.Identifier}的新TeamSettingsIterationoSprint = oWorkClient.PostTeamIterationAsync(oSprint,oContext).Result最终使用最终使用返回osSprint结束功能
您可以使用 UpdateTeamFieldValuesAsync()
方法将现有区域添加到现有团队中.检查这里.
I have an Area that I've created using the SDK, and I have a Team. How can I, using the SDK, add that Area to the Team?
It's simple enough to do so with an Iteration, using the WorkHttpClient.PostTeamIterationAsync()
method (code below), but there's no corresponding method available to do the same with an Area.
I looked briefly at the method's source code, but it contains a GUID
indicating the target location (Iterations). If I can avoid it, I'd rather not risk getting down to that level by modifying it for my own use for Areas. Surely there's a higher-level way to do this.
According to this Q&A, it can be done via the REST API—but I'm using the SDK. Then there's this, but the answers there appear to be using an outdated version. The classes referenced aren't available in the latest stable version.
Can this be done?
Private Function AddSprintToTeam(Sprint As Classifications.Iteration) As TeamSettingsIteration
Dim oContext As TeamContext
Dim oSprint As TeamSettingsIteration
Dim oTeams As List(Of WebApiTeam)
Dim oTeam As WebApiTeam
Using oTeamClient As TeamHttpClient = Utils.Connection.GetClient(Of TeamHttpClient)
Using oWorkClient As WorkHttpClient = Utils.Connection.GetClient(Of WorkHttpClient)
oTeams = oTeamClient.GetTeamsAsync(ProjectName).Result
oTeam = oTeams.Single(Function(Team) Team.Name.StartsWith(ProjectName))
oContext = New TeamContext(ProjectName, oTeam.Name)
oSprint = New TeamSettingsIteration With {.Id = Sprint.Identifier}
oSprint = oWorkClient.PostTeamIterationAsync(oSprint, oContext).Result
End Using
End Using
Return oSprint
End Function
You can use UpdateTeamFieldValuesAsync()
Method to add an existing Area to an existing Team. Check here.
See the related rest api here. You can check out the example given in the Rest api document.
这篇关于如何将现有区域添加到现有团队?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!