Is there any way in Visual Studio to prefix comment while commiting? - visual-studio

From the screenshot below
I want to prefix my comment to the changes including work item's id. So I expect to get this:
TFS - 123: Want to prefix this comment with work item's id
Currently I need to enter work item's id in both places in Comment and Related Work Items sections which is borring. What I want is just pass them into one place (Related Work Items section) and when I click Check In Visual studio will automatically prefix my comment.
Would be nice to set some pattern how to prefix:
TFS - {id}: {comment} or something like that in Visual Studio settings.

Related

Adding work item id by default in the related work items

Every time when I check-in the code in Visual Studio, I need to provide the product backlog item's work item id (task id) in the pending changes window's Related Work Items section.
If I'm working on a module for a week, on each check-in I need to provide the same work item id (at least 5 to 6 check-in in a day). It seems repeating of work.
Is there any possible way to add the work item id by default in the "Related Work Items" section in the Visual Studio settings?
I'm using Visual Studio 2017 and TFS 2012.
Sorry, it's not able to do this. It will not cached the ID you previous entered.
Instead of entering ID, you could also drag work items here to link work item to check in.
Or you could do it the other way around, open the work item and add a link to your previous changeset.
Get the changeset ID by looking at the History of one of the changed files
Open the relevant work item
Select the Links tab
Click the Add button
Select "Changeset" from the Link type dropdown
Enter the changeset ID (from step 1) into the Changeset field, and click OK
Save the work item
After this the work item will also appear in the changeset's list of associated work items.
No, that`s not possible. You may add all your changes to work item after your work will be done:
You may try to use a custom tool with TFS API like that: How to checkin source code with work item associated using TFS API.

Hide TODO tag in Visual Studio Task List

Our codebase has a bunch of TODO comments that no one will ever fix and that the boss refuses to remove.
I would like to hide the TODO's from the Visual Studio task list and just show my custom MEDO tags.
It appears that Visual studio will not let you remove the TODO tag from the task list. The remove button is grayed out for TODO. (You can remove all the other default tags, just not TODO.)
Does anyone know some kind of hack or something that will allow me to remove them anyway? Maybe editing some config file somewhere?
As you've discovered, Visual Studio won't allow you to modify the TODO token, but you can trick it by using the Priority settings to filter it out.
First, set your MEDO token to "High Priority" as shown here:
Then filter the Task List window to only show high priority items. (The filter button is hard to see on that column - you may need to widen it a bit.)
By default, Visual Studio includes the following tokens: HACK, TODO, UNDONE, NOTE.
All you need to do is to remove the TODO from these list of predefined tokens. (you can create your own tokens as well)
On the Tools menu, choose Options.
Open the Environment folder and then choose Task List and then delete the TODO token.
So now you will continue to have TODO comments in your codebase but they will not show in your task list.

TFS 2012: Change work item type

I have TFS 2012 installed. I want to change work item types, e.g. from bug to test case or something else. How can I do it? Maybe configure process template or tfs somehow? I have admin permissions, but don't know what and where to change.
I've already tried to export these items to Excel, but "Work item type" field in exported file is read-only.
You cannot change a work item type; however, you can create a copy of a work item to another type through the web access or Visual Studio. See this blog post for detailed instructions.

How do I make custom comment tokens?

According to this, VS 2008 and 2010 had a feature called Comment Tokens. You can write // TODO document this magic number here and it will appear in your Comments section of the Task List. This part works for me.
However, that article says that you can even define your own tokens, by going to Tools>Options>Environment>Task List .
However, in my Visual Studio 2010 Ultimate, I don't have that option.
How do I make custom comment tokens?
Just check the "Show all settings" checkbox you see at the bottom left of the Options dialog. You now should be able to navigate to "Environment | Task List" to create your custom comments. Here is an additional link How to: Create Custom Comment Tokens

Visual Studio 2010: Search within Team Explorer query results without modifying the query

Imagine you have a query that looks like this.
and it returns all the items whose title contains the string "fixed". However, I'd like to refilter the results further - for example, searching for another string in the title (ex. ListBox). Is it possible to do that without modifying editing the query and adding another And clause? I need something quick - like pressing for example CTRL + F and typing the string I need to find in the results of a query.
Did you check out the Search Work Items for TFS 2010 from VS Code Gallery?
This extension creates a search box in a Visual Studio 2010 toolbar and Team menu which is used to pull up a work item directly by its ID or search through work items based on text entered.
http://visualstudiogallery.msdn.microsoft.com/en-us/3f31bfff-5ecb-4e05-8356-04815851b8e7
Another great option here is the integration with Excel. Just connect to TFS through the "Team" tab, and run your query. You can then use the built-in Excel filtering and sorting tools as you need to, make changes, and re-publish them to the TFS server.
We use this functionality extensively.

Resources