TFS power tools command enable to make bulk edit on work items filtered through queries.
Consider a particular scenario when a team member is leaving the project and you want to assign all the stories, bugs etc assigned to him to a new member and also want to provide related comments. Using UI this task may be quite time consuming.
For example: Updating all work items assigned to me to be assigned to Jason (uses Query)
tfpt Query /format:id “project1\Team Queries\My Work Items” | tfpt workitem /update @ /fields:”Assigned To=Jason”
All other options of this command are as below:
C:\Program Files\Microsoft Team Foundation Server 2010 Power Tools>tfpt workitem /?
tfpt workitem – Create, update, or view work items
Usage: tfpt workitem [workitemid1 workitemid2 … | @ | @filename]
Usage: tfpt workitem /new type /fields:[field1=value1[;field2=value2;…]|@filename]
Usage: tfpt workitem /update [workitemid1 workitemid2 … | @ | @filename] /fields:[field1=value1[;field2=value2;…]|@filename]
Usage: tfpt workitem /uploadattachment workitemid /recursive /comment:[commenttext|@filename] file1 [file2] [file3 …]
Usage: tfpt workitem /downloadattachment workitemid [filepattern1 …] /path:folder
/new Specifies that a new work item of the type entered be created. The number of the new work item is displayed.
type Represents the name of the work item type to create. Use the form <project>\<workItemType>.
/update Specifies that work items should be updated. To read the list of work items from stdin put ‘@’ on the commandline. Use ‘@filename’ to read from a file.
/fields Specifies the fields that are changed and the new values to give to them.
fieldN The name of a field to update.
valueN The value to set on the fieldN.
filename The file that has the field/value pairs to use.
/uploadAttachment Specifies that files should be uploaded and attached to the work item.
/comment Specifies a comment to associate with the attachments.
commenttext The text for the comment.
filename The file that contains the text for the comment.
/recursive Include subdirectories when searching for files.
/downloadAttachment Specifies that attachments should be downloaded to the current path.
/path Specifies a path to download the files to
folder The folder to download files to.
workitemidN Specifies the id of the work item to retrieve.
fileN Represents the name of a file to upload. File patterns are supported (i.e. *.cs).
fileN Represents the name of a file to upload. File patterns are supported (i.e. *.cs).
filePatternN Represents the name of an attachment to download. File patterns are supported (i.e. *.cs).
/server:servername Specifies the URL of the Team Foundation server to connect to.
Example: /server:http://mytfsserver:8080/
Examples:
Creating a new Bug work item with a title of ‘New’ and assigned to Jason
tfpt workitem /new project1\Bug /fields:”Title=New;Assigned To=Jason”
Updating work item 123 with field values from a file
tfpt workitem /update 123 /fields:@myFieldValues.txt
Updating all work items assigned to me to be assigned to Jason (uses Query)
tfpt Query /format:id “project1\Team Queries\My Work Items” | tfpt workitem /update @ /fields:”Assigned To=Jason”