Visual Studio 在线 TortoiseGIT 集成

Visual Studio Online TortoiseGIT integration

是否可以将 Visual Studio 在线与 TortoiseGIT 问题跟踪器集成?最好键入 # 并查看要提交的工作项列表。

目前,我可以通过使用#[workitem number] 开始一条消息来提交,它将在 Visual Studio 在线绑定。例如。 #1 提交信息

从存储库中查找时,我似乎找不到任何问题跟踪器;

turtletfs 提供程序(包含源代码)使用 TFS/VSTS API 从 TFS/VSTS 获取工作项,但此提供程序太旧,您可以构建自己提供 TFS/VSTS API.

获取工作项的简单代码TFS/VSTS API:

var tfs = TeamFoundationServerFactory.GetServer("https://[account].visualstudio.com");
            tfs.EnsureAuthenticated();
            var workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
          var r=  workItemStore.Query("select[System.Id], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State], [System.Tags] from WorkItems where [System.TeamProject] = 'ScrumStarain' and [System.WorkItemType] = 'Product Backlog Item' and [System.State] <> ''");

另一个示例:

var u = new Uri("https://[account].visualstudio.com");
VssCredentials c = new VssCredentials(new Microsoft.VisualStudio.Services.Common.WindowsCredential(new NetworkCredential("[alternate user name]", "[password]")));
 var connection = new VssConnection(u, c);

            var workitemClient = connection.GetClient<WorkItemTrackingHttpClient>();
var result = workitemClient.QueryByWiqlAsync(new Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.Wiql() { Query = "select[System.Id], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State], [System.Tags] from WorkItems where [System.TeamProject] = 'ScrumStarain2' and [System.WorkItemType] = 'Product Backlog Item' and [System.State] <> ''" }, "ScrumStarain2").Result;