I totally agree that turning TODO elements into work elements is the wrong way.
But, considering this as an exercise with the capabilities of the instrument, I think this can be achieved. You can define a dummy assembly with custom activity in it.
Here's a series of Ewald Hoffman's blog posts explaining how to set up Team Build. http://www.ewaldhofman.nl/post/2010/05/13/Customize-Team-Build-2010-e28093-Part-5-Increase-AssemblyVersion.aspx
Part 5 discusses how to automatically increase the assembly version with each assembly. He does this by including a custom action in an assembly that scans code files to catch a text template (in this case, the assembly's xml tag) and update it.
The same approach can be used to capture TODO elements (for the sake of exercise), and work elements can be created using the TFS API.
Again, I do not recommend doing this, but this method can be used to solve other similar problems.
source share