tfs-sdk

TFS 2012 API Set TeamSettings Programmatically

六月ゝ 毕业季﹏ 提交于 2019-12-01 18:20:21
Is it possible to set the TeamSettings Programmatically? var teamConfig = _tfs.GetService<TeamSettingsConfigurationService>(); var css = _tfs.GetService<ICommonStructureService4>(); var configs = teamConfig.GetTeamConfigurationsForUser(new[] { _selectedTeamProject.Uri }); var team = configs.Where(c => c.TeamName == "Demo").FirstOrDefault() as TeamConfiguration; The above code gives me the Team Configuration for the team Demo. Look at the TeamSettings, it contains the property BacklogIterationPath, CurrentIterationPath, IterationPaths. How can these be set programmatically? I think I have

Programmatically add new iteration in TFS

回眸只為那壹抹淺笑 提交于 2019-12-01 17:53:52
I can manually add a new iteration to a team project in TFS by right clicking on the project and going to Team Project Settings > Areas and Iterations > Iterations tab. Is there an example out there of how to do this programmatically using their API? Thanks! taylonr Does this tutorial solve your problem? http://blogs.microsoft.co.il/blogs/shair/archive/2009/01/30/tfs-api-part-10-add-area-iteration-programmatically.aspx Google-Fu "tfs api add iteration" From glancing at his code, (and using TFS) it looks like iterations are getting treated as hierarchies. That's why you see things like

TFS 2012 API Set TeamSettings Programmatically

↘锁芯ラ 提交于 2019-12-01 17:48:23
问题 Is it possible to set the TeamSettings Programmatically? var teamConfig = _tfs.GetService<TeamSettingsConfigurationService>(); var css = _tfs.GetService<ICommonStructureService4>(); var configs = teamConfig.GetTeamConfigurationsForUser(new[] { _selectedTeamProject.Uri }); var team = configs.Where(c => c.TeamName == "Demo").FirstOrDefault() as TeamConfiguration; The above code gives me the Team Configuration for the team Demo. Look at the TeamSettings, it contains the property

TFS - VS Extension: Add work item to pending changes via API

房东的猫 提交于 2019-12-01 14:19:00
I am currently working on a VS extension / add-in and I need to associate work items with the pending changes (without triggering a check-in). After searching for some hours I couldn't find a way to accomplish this via the API. The only way I found to associate a work item to the pending changes is Workspace.CheckIn() which also would trigger the check-in.. Do I miss something? Or is this really not possible? I have provided the sample code below, Note that, I have not tried this code, but it seems it is only possible through some reflection as there is no public method to achieve this in the

TFS client C# API - get all changesets of an Item

馋奶兔 提交于 2019-12-01 11:30:54
问题 Microsoft TFS client for VS 2010: http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.item(v=vs.100).aspx I (i.e., my code) have a Changeset. I iterate to a particular Change. I have an Item in the Change. Now, I wish to get all Changesets that had Changes for that item. Could someone advise me the best way to do that? I could iterate thro all the Changesets of the branch concerned, which would be very inefficient. 回答1: Edward is correct. And he has the

How can I add an attachment via the SDK to a work item without using a physical file?

主宰稳场 提交于 2019-12-01 09:06:25
I'm trying to create a new work item for TFS 2010 via the client SDK. In the SDK you can do something like this: WorkItem item = ...; item.Attachments.Add(new Attachment("c:\\path\\on\\tfs\\server\\shot.png", "Screen shot")); item.Save(); But this requires the file being attached to be placed on either a network accessible path, or on a disk in the TFS server itself. In our case the file being attached is just an in-memory blob, and having to save attachments to a physical path seems unnecessary and definitely complicates the deployment steps required by our customers, as we need to put them

Check-in code into TFS Server by using TFS API

风格不统一 提交于 2019-12-01 08:01:24
I'm writing c# code to check-in code to TFS server: Workspace WS = VersionControl.GetWorkspace(TeamProject); WS.Map(TFSMapServerPath,LocalWorkingPath); int NumberOfChange = WS.PendAdd(string.Format(@"{0}\Main\DotNet\",LocalWorkingPath),true); PendingChange[] pendingChanges = WS.GetPendingChanges(); WS.CheckIn(pendingChanges,"Auto Check-in"); But i got the error is "No files checked in", all files/folders under LocalWorkingPath are "Pending Change". Are the above codes correct? I changed the command WS.GetPendingChanges() to WS.GetPendingChanges(tfsServerFolderPath,RecursionType.Full) and it is

How can I add an attachment via the SDK to a work item without using a physical file?

淺唱寂寞╮ 提交于 2019-12-01 07:18:21
问题 I'm trying to create a new work item for TFS 2010 via the client SDK. In the SDK you can do something like this: WorkItem item = ...; item.Attachments.Add(new Attachment("c:\\path\\on\\tfs\\server\\shot.png", "Screen shot")); item.Save(); But this requires the file being attached to be placed on either a network accessible path, or on a disk in the TFS server itself. In our case the file being attached is just an in-memory blob, and having to save attachments to a physical path seems

Show Test result Form test suites using TFS api

醉酒当歌 提交于 2019-12-01 06:23:33
I am working with a school project where I am going to analyse a companies defect database. They are using Microsoft Foundation Server (TFS). I am all new to TFS and the TFS api. I have some problem in getting the right data from TFS using the TFS Client Object Model . I can retrieve all Test Plans, their respective test suites and every test case that a specific test suite uses, but the problem comes when I want to see in which test suite I have a specific test result from a test case. Since more than one the suite can use the same test cases, I cant see in which suite the result came from. I

TfsConfigurationServer.GetService<VersionControlServer>() always returns null

爷,独闯天下 提交于 2019-12-01 04:16:54
I'm trying to connect to TFS 2010 using TFS SDK, but can't get VersionControlServer service. var servers = RegisteredTfsConnections.GetConfigurationServers(); // ok then var tfs = new TfsConfigurationServer(servers.First().Uri, CredentialCache.DefaultNetworkCredentials); // or var tfs = new TfsConfigurationServer(servers.First()); both always returns null: var vc = (VersionControlServer)tfs.GetService<VersionControlServer>(); // null! What should I do? You don't want the configuration server, you want the project collection. The version control service is scoped to a team project collection.