如何在TFS 2015中使用Rest API在团队项目中创建新团队

如何在TFS 2015中使用Rest API在团队项目中创建新团队,api,rest,tfs,tfs-2015,Api,Rest,Tfs,Tfs 2015,我正在使用TFS 2015和更新2。我尝试使用TFS rest API来创建、更新和删除TFS中的内容,而不是使用web界面。 我们有来自TFS的现成API来创建团队项目。但中没有列出在团队项目中创建新团队的API 我试过Powertools exe。它也没有创建新团队的方法 有人可以帮助我如何使用Rest API在团队项目中创建新团队。Rest API目前只能获取团队项目中的团队,它不支持创建团队。有关详细信息,请参阅此链接:。您可以在上提交功能请求 实现这一点的另一种方法是使用以下代码示例:

我正在使用TFS 2015和更新2。我尝试使用TFS rest API来创建、更新和删除TFS中的内容,而不是使用web界面。 我们有来自TFS的现成API来创建团队项目。但中没有列出在团队项目中创建新团队的API

我试过Powertools exe。它也没有创建新团队的方法


有人可以帮助我如何使用Rest API在团队项目中创建新团队。

Rest API目前只能获取团队项目中的团队,它不支持创建团队。有关详细信息,请参阅此链接:。您可以在上提交功能请求

实现这一点的另一种方法是使用以下代码示例:

using System;
using System.Collections.Generic;
using Microsoft.TeamFoundation.Client;

namespace ConsoleApplica
{
    class Program
    {
        static void Main(string[] args)
        {
            string URL = "https://xxxxxx.visualstudio.com/";
            TfsTeamProjectCollection ttpc = new TfsTeamProjectCollection(new Uri(URL));
            TfsTeamService tts = ttpc.GetService<TfsTeamService>();
            string teamprojecturi = "teamprojecturi";
            string newteamname = "newteam";
            string teamdescription = "newteamdescription";
            IDictionary<string, object> prop = null;//properties, can be null or empty
            tts.CreateTeam(teamprojecturi, newteamname,teamdescription,prop);
        }
    }
}
使用系统;
使用System.Collections.Generic;
使用Microsoft.TeamFoundation.Client;
名称空间控制台应用程序
{
班级计划
{
静态void Main(字符串[]参数)
{
字符串URL=”https://xxxxxx.visualstudio.com/";
TfsatmProjectCollection ttpc=新TfsatmProjectCollection(新Uri(URL));
tfstreamservice tts=ttpc.GetService();
字符串teamprojecturi=“teamprojecturi”;
字符串newteamname=“newteam”;
string teamdescription=“newteamdescription”;
IDictionary prop=null;//属性,可以为null或空
创建团队(teamprojecturi、newteamname、teamdescription、prop);
}
}
}

RESTAPI目前只能获取团队项目中的团队,它不支持创建团队。有关详细信息,请参阅此链接:。您可以在上提交功能请求

实现这一点的另一种方法是使用以下代码示例:

using System;
using System.Collections.Generic;
using Microsoft.TeamFoundation.Client;

namespace ConsoleApplica
{
    class Program
    {
        static void Main(string[] args)
        {
            string URL = "https://xxxxxx.visualstudio.com/";
            TfsTeamProjectCollection ttpc = new TfsTeamProjectCollection(new Uri(URL));
            TfsTeamService tts = ttpc.GetService<TfsTeamService>();
            string teamprojecturi = "teamprojecturi";
            string newteamname = "newteam";
            string teamdescription = "newteamdescription";
            IDictionary<string, object> prop = null;//properties, can be null or empty
            tts.CreateTeam(teamprojecturi, newteamname,teamdescription,prop);
        }
    }
}
使用系统;
使用System.Collections.Generic;
使用Microsoft.TeamFoundation.Client;
名称空间控制台应用程序
{
班级计划
{
静态void Main(字符串[]参数)
{
字符串URL=”https://xxxxxx.visualstudio.com/";
TfsatmProjectCollection ttpc=新TfsatmProjectCollection(新Uri(URL));
tfstreamservice tts=ttpc.GetService();
字符串teamprojecturi=“teamprojecturi”;
字符串newteamname=“newteam”;
string teamdescription=“newteamdescription”;
IDictionary prop=null;//属性,可以为null或空
创建团队(teamprojecturi、newteamname、teamdescription、prop);
}
}
}

团队项目中的团队是什么意思?团队内部团队项目与普通团队项目有什么区别?团队内部团队项目的详细含义是什么?团队内部团队项目与普通团队项目有什么区别?谢谢Eddie。这有帮助。如果您知道的话,请您帮助我了解如何使用tts.updateeam()更新团队中的区域、迭代、区域安全性和所有其他参数。我只在团队对象中将内部的一切都视为GUID。UpdateTeam()方法只能更新团队的基本信息,如名称、描述。您需要将API用于区域、迭代、安全相关,以实现您想要的功能。您可以参考此链接了解详细信息:谢谢Eddie。这有帮助。如果您知道的话,请您帮助我了解如何使用tts.updateeam()更新团队中的区域、迭代、区域安全性和所有其他参数。我只在团队对象中将内部的一切都视为GUID。UpdateTeam()方法只能更新团队的基本信息,如名称、描述。您需要将API用于区域、迭代、安全相关,以实现您想要的功能。有关详细信息,请参阅此链接: