tfs-sdk

TFS API - Updating a work item field

∥☆過路亽.° 提交于 2019-12-07 06:38:23
问题 Is it possible to update a field of a work item using the TFS API ? Something along this line: WorkItemStore.GetWorkItem(Convert.ToInt32(current.WorkItemId)).State = rcbState.SelectedValue; 回答1: You can set update your WorkItem properties as you show above, just be sure to save them once your done with it. Something like: WorkItem item = WorkItemStore.GetWorkItem(Convert.ToInt32(current.WorkItemId)); item.State = rcbState.SelectedValue; item.Save(); 来源: https://stackoverflow.com/questions

Show item history windows with TFS SDK

寵の児 提交于 2019-12-07 04:18:49
问题 I'm writing an app that integrates with TFS via the official SDKs to automate and support various common actions. Although most of it is automation and the TFS API exposes pretty much everything I need, some of the actions need user intervention so I need to display information to the user. I've found methods such as Difference.VisualDiffItems that allow me to easily compare files visually using the same UI that Visual Studio uses. I also need to display an item's history (including branches,

TFS 2013 API - Retrieve all changes made for WI

一世执手 提交于 2019-12-06 15:09:10
Does anybody knows how to get all changes related to work item, like how many hours were logged per day? This info is obtainable in web version of TFS in 'All Changes' tab but I couldn't find it by looking through all methods and properties of WorkItem object in debug. I've also tried to retrieve work items by WorkItem property on RevisionCollection's indexer which returns Revision object, but all these work items seems to be referencing to the final state of WI where all hours have been logged and the task is closed. If you mean you want to show all the history (what fields changed, when and

List Source Control Files and Folder under a given TFS Path (without work-space mapping)

牧云@^-^@ 提交于 2019-12-06 13:29:39
问题 I'm redesigning a control that lists the contents (files and folders) under a given TFS path. The tricky part is that I don't want to create a workspace for achieving this, as my intention is just to list the contents and display the history of a selected item. The current implementation creates a local workspace mapping in the background to achieve this, is this needed? Can I attain this without a local workspace mapping? Thanks Joe. 回答1: Use GetItems, which does not require a workspace. For

Using the TFS 2010 API to subscribe to Workspace Events

给你一囗甜甜゛ 提交于 2019-12-06 08:57:11
I'm trying to write some code that monitors the TFS workspace(s) on my local workstation but at the moment I'm having problems getting the events to fire. For example if I map a new folder in my workspace I want to subscribe to the versionControl.UpdatedWorkspace event, and if I do a “get” I want to map to the versionControl.Getting event. The code below is a console application that I think should work, but when I do a get nothing happens. Does anyone know how to successfully subscribe to these events? VS2010, TFS 2010, WinXP SP3 using System; using System.Collections.Generic; using System

How to add users programmatically to TFS

允我心安 提交于 2019-12-06 07:08:47
问题 I want to add users programmatically to a Team Project. What I found out to be the solution was this: IGroupSecurityService gss = (IGroupSecurityService)objTFS.GetService(typeof(IGroupSecurityService)); Identity identity = gss.ReadIdentity(SearchFactor.AccountName, "Group name", QueryMembership.None); gss.AddMemberToApplicationGroup(groupProject.Sid, member.Sid); But this only work for groups/users known to TFS. I want to add a Windows account to TFS For example: Windows account name: TestTFS

TFS: Query for builds containing a specific changeset

依然范特西╮ 提交于 2019-12-06 00:47:34
问题 I have a number of build definitions that get executed based upon a single branch in TFS (eg Main). I'd like to (somehow) query TFS to find all builds containing a specific changeset number that I supply, and return a list of string of the names of the builds that TFS contains. Any kind of app (VS extension, CLI app, winforms, whatever) will do. Note: this isn't a 'plz give me the code' request; I'm willing to hoof it and do serious work on this. Any pointers to documentation on how to query

Programatically forcing field values for a TFS WorkItem

无人久伴 提交于 2019-12-06 00:06:10
问题 I am writing a utility to read all the defects out of a legacy bug tracking system, and import them into TFS (2008/2010). I am using the TFS API to create new WorkItems, set their fields, and then save them. However I am unable to modify the "Created By" and "Created Date" fields, as these are set by the system. (and there are other fields too which I would like to be able to force values for, such as setting the submitter to be someone who is not a valid TFS user) // these fail with "The

Show item history windows with TFS SDK

核能气质少年 提交于 2019-12-05 13:08:35
I'm writing an app that integrates with TFS via the official SDKs to automate and support various common actions. Although most of it is automation and the TFS API exposes pretty much everything I need, some of the actions need user intervention so I need to display information to the user. I've found methods such as Difference.VisualDiffItems that allow me to easily compare files visually using the same UI that Visual Studio uses. I also need to display an item's history (including branches, renames, etc.) and I would love to use a built-in UI instead of having to write my own. The item

How to get history of checkins/changsets for specific Team Project?

你离开我真会死。 提交于 2019-12-05 06:15:26
I'm using the TFS Client API to try and query a TFS 2010 instance. I need to be able to do the following For a specified team project, say 'Project A' Get a list of the history of recent check-ins made to this project (say the last 50, or the list for the last day) Then be able to iterate through this list and get some metadata for the items (file and folder names ideally) I think I need to use the QueryXXX methods on the VersionControlServer class, but cannot find any helpful or clear examples on how to use this. I have seen there is GetLastestChangesetId method, but this doesn't look like it