Is there a chance to delete Work Item from TFS, or all I can do is just to rename it.
Update:
This question was for TFS 2008.
New version (2010) have out of the box solution as Rob Cannon suggested
The answers here are obsolete for TFS 2010. You need to use the 'witadmin destroywi' command now.
http://msdn.microsoft.com/en-us/library/dd236908.aspx
See this tool: http://devmatter.blogspot.com/2009/04/deleting-work-items-in-tfs-ui.html
the Team Foundation Client does not include any functionality for deleting work items from TFS.
Although it’s a tad inconvenient, you can delete work items from TFS by installing the Team Foundation Server Power Tools (October 2008 release or greater). Of the many features available as part of the power tools, there is a command called destroywi that can be used to delete work items. For example, to delete the work item ID 1234, use the command:
tfpt destroywi /server:tfs-dev /workitemid:1234
Although this is a relatively straightforward task to perform, not everyone is comfortable with the command line interface not to mention you have to look up the work item ID(s) ahead of time. To ease the process a little bit, I created a simple UI that sits on top of the Team Foundation Server Power Tools that allows you to easily select a Team Foundation Server and Project to query from. You can run an existing query to display a list of work items from which you can select one or more work items to be deleted. You can also enter the work item IDs directly (as a comma-separated list) if you prefer...
No one added code or an example, so here is my re-iteration of this answer using Rob Cannon's answer as guidance above.
This is batch file code for accomplishing this task. You will be prompted before you actually delete your Work Item.
ECHO OFF
SET "VSDir=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\"
CD %VSDir%
SET /p WorkItemID=Enter Work Item ID:
ECHO.
witadmin destroywi /collection:{TFS Server}/{Collection Name} /id:%WorkItemID%
ECHO.
PAUSE
Enjoy
If you want to do this without using the tool suggested in the accepted answer, here is a quick summary of what to do. This is based on the corresponding MSDN article suggested in another answer.
Open Visual Studio Command Prompt:
Using the start menu:
Search for it.
Or navigate to All Programs -> Microsoft Visual Studio X -> Visual Studio Tools to find it.
Invoke witadmin
Determine the team project collection URL. An example is http://ServerName:Port/VirtualDirectoryName/CollectionName.
Determine the work item id.
Invoke the following command, substituting the two above values:
witadmin destroywi /collection:CollectionURL /id:id
See the MSDN article for more details. Note that you need permission for this to work.
You have to use the TFS Power Tools.
http://msdn.microsoft.com/en-us/vstudio/bb980963.aspx
1) As mentioned above the destroy command (pretty tiresome if you have to delete more than a single item)
2) With TFS 2015.2 you get a new recycle bin function (without an option to permanently remove the items).
https://www.visualstudio.com/en-us/news/tfs2015-update2-vs.aspx#delwork
But since they dont appear anywhere (replaces the "Removed" State) and they can be restored ... compared to the fact that it took since 2008 to add the bin feature .. pretty neat id say :D
Related
We are using Microsoft Test Manager 2015 Update 1. I created a couple of shared parameters to see how they work.
How do you delete them? I can make them inactive, but they still display in the list of available shared parameters. I don't see a delete button and when I searched online I found nothing about it.
Shared Parameters are stored in TFS as Work Items so you could destroy it (there may be a better way but I don't know of one)
Remove or delete work items
On-premise you'll have to use the witadmin.exe command line tool (%programfiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE) with the destroywi option. You'll need to know the ID of the Shared Parameter Work Item you want to get rid of.
witadmin destroywi /collection:http://TFSServerName:8080/tfs/DefaultCollection /id:123
I want to use a .MPP MS Project 2007 plan which has not yet been mapped to work items in TFS, the TFS project is empty, I mean that there are no work items at all. I want to synchronize with http://localhost:8080/tfs/ so that I can transfer my entire business plan to TFS work items, but this is not working. I have tried doing this:
Open VS 2010 shell:
witadmin importwitd /collection:http://localhost:8080/tfs/ /p:"MyProject" /f:"Z:\task.xml"
but I still can't publish to TFS in MS Project, I get this error:
TF80006: Team Foundation needs a work item type to publish work items. Select a work item type for the work items you have added and then try again.
How can I fix this?
I have resolved this issue:
Download and install the Team Foundation Server Power Tools plugin for VS2010 here.
Under Tools > Process Editor > Work Item Types > Open WIT from Server to obtain the work item type from a TFS project on your TFS server. I selected "Task".
Publish again, this time edit the lines that have validation errors. The fields in yellow will have to be changed accordingly. Or, you can disable validation by following these steps.
One of gotchas that bit me was that I did not set the Work Item Type in Project. Once I set it to 'Task' I was able to publish my schedule to TFS.
Our situation:
In TFS 2010 + VS 2010 environment, we need to move source code and work items from old project to new project (new project is just for renaming and restructuring purposes, they all under one project collection).
We used TF.exe command line utility moved source code, it's good and carried history and links (changeset links to original bugs/tasks). We are happy about it.
Trouble appears when We tried to use TFS integration tool (MS recommendation) to move work items, it only carries forward attachments but no links. We need those links to link to our changeset. it's very important to us.
As I dig deeper, I know this "move" is not "real move" but creating new ID and copy the old information. Just wonder is there a way to do the move and still keep our links in bugs and tasks.
Thanks a lot
I got the following link from Link.
Have you looked at Hemi - Hemi is a tool that helps you move work items from one team project to another in Team Foundation Server.?
I think this is TF2008 - so you may be able to update the source to VS2010
I know there is an easy way to do this with SVN so there must be a similar way with TFS.
Basically, I want to have a list of every file a particular username ever edited (IE: checked out & changed or added). This is on TFS 2008.
I found one way to do it:
Go to Source Control Explorer in Visual Studio
Right click on the project root
Select Find in Source Control -> Changesets
Enter the username you are looking for in the 'By User' field
Click find
This returns a list of changesets from the user. You can then click the details button to expand the changeset.
The answers so far return a list of changesets, not a list of files. Try:
Get-TfsItemHistory $/ -r -user username -all | Select-TfsItem | sort -unique path
Using the Powershell cmdlets also included with the Power Tools.
Bryan - the answer you provided is one way. You can also do this in fewer steps by installing the free Team Foundation Server Power Tools - October 2008 Release from MSDN. There are a number of great out-of-band updates to the Team Explorer feature set, but the one you are interested in is called the Team Members feature:
Team Members Node http://img34.imageshack.us/img34/7195/image21k.png
This will allow you to quickly search for all check-in's by a given Team Member. Look around at the other features as I am sure you will find some other handy things as well. Personally, I like the "Show Shelvesets" as it makes it much easier to use the Shelveset feature for code reviews, etc.
I know how to do this in VS2010 and I'm sure it works the very similar in VS 2008 --
In Visual Studio, open "Team Explorer" window.
Expand your main TFS branch.
Expand "Team Members" branch. Under this branch you will see the names of all TFS members.
Right-click a member, and select "Show Checkin History". This will list all the files changed (checked in) by the selected member.
I hope this helps. Good luck!
We have a rule in TFS that requires all checkins to be associated with a work item. We have an automated daily build process that uses tf.exe to check in the files. However, I did not find any way to associate files with a work item.
I heard of tfpt, and have it installed, however, I did not have any success using it to associate files with a changeset either.
Is there another way to do this?
Thanks!
I'm pretty sure tf.exe / tfpt.exe cannot do this except through their UI. If you need to use the -noprompt parameter for automation then you're likely out of luck.
Luckily, it's not hard to use the API directly. MSDN link. Basically just build up an array of WorkItemCheckinInfo[] and pass it along with your request.
Team Foundation Power Tools has a command for dealing with work items.
tfpt.exe help workitem