Make the description field formattable

by Ewald Hofman 4. August 2009 05:41

By default the description field in the work item definition (for example the Task work item), is plain text. To modify the type of the field to Html, you have to do the following:

Step Action
1 Open the command prompt (Run as Administrator)
2 Go to the folder %Program Files%\Microsoft Visual Studio 10.0\Common7\IDE
3

Export the work item with the following command:

witadmin exportwitd /s http:// <server> :<port>/<virtual directory>/<project collection> /p <team project> /n <work item type name> /f <location>
Example:
witadmin exportwitd /s http://MyTfsServer:8080/tfs/DefaultCollection /p TestProject /n Task /f c:\task.xml
4 Open the work item definition (in the example c:\task.xml) in Visual Studio or any other xml editor
5

Go to the FIELD

      <FIELD name="Description" refname="System.Description" type="PlainText">
        <HELPTEXT>What to do, pointers to resources and inputs, design notes, exit criteria</HELPTEXT>
      </FIELD>

6

You cannot change the type of an existing field, so just add a new field. Add a new FIELD section to the xml file:

      <FIELD name="DescriptionHtml" refname="Custom.DescriptionHtml" type="HTML">
        <HELPTEXT>What to do, pointers to resources and inputs, design notes, exit criteria</HELPTEXT>
      </FIELD>

7

Now change the field that is shown in the description textbox. Go to the section

<Control FieldName="System.Description" Type="HtmlFieldControl" Label="&amp;Description:" LabelPosition="Top" Dock="Fill" />

8

And change it to:

<Control FieldName="Custom.DescriptionHtml" Type="HtmlFieldControl" Label="&amp;Description:" LabelPosition="Top" Dock="Fill" />

9 Save the file
10

Import the new work item definintion with the command:

witadmin importwitd /s http:// <server> :<port>/<virtual directory>/<project collection> /p <team project> /f <location>
 
Example:
 
witadmin importwitd /s http://MyTfsServer:8080/tfs/DefaultCollection /p TestProject /f c:\task.xml

When you have completed the tasks, your new Task work item will look like:

 

Tags:

VSTS 2008 | VSTS 2010 | Work items

Comments

11/16/2009 4:29:16 AM #

vineet kanungo

hey , its Very nice post , i tried it , but one problem when i import all files all my Existing Description In the previous Work item are gone , i had to import back the previous template to get them  , is there any way that Old Description are not gone when we format the Description.

vineet kanungo India |

11/16/2009 4:50:38 AM #

Ewald Hofman

In the post, you have added an extra field into the 'database', and changed the field you are showing. So the data is actually not removed, but it is hidden. To get the old information, you could either use MS Excel to show both columns and copy the information, or you could add the control to the work item canvas. The latter you do by changing step 8 from "Change <Control" to "Copy the line <Control..." and change the FieldName. You have now 2 lines in the Description tab.

Ewald Hofman Netherlands |

11/17/2009 4:41:58 AM #

vineet kanungo

Thanks Ewald , i used second Option ( Two Lines of Description ) , and it works , Little
Copy/Paste , but its OK , Thanks A Lot , i am Doing the Work of Customizing TFS For my
Team , I would need your Help , i Am Planning to Use TFS Api to Cistomized OUr TFS , and i have no idea how to use it , i see a Lot Of Posts and they have shown little piece of COde ,
but no one shown How to use it ?? Can u Help me in that???

Thank Again.  

vineet kanungo India |

7/12/2010 2:16:53 AM #

Riesi

Changing the decription field from System.Description into some custom field will make you loose the ability to search within descriptions, for example in the WebAccess-Searchfield. It then only searches in the title.

Riesi Austria |

Comments are closed

Powered by BlogEngine.NET 1.6.1.0
Theme by Mads Kristensen


ClusterMap

Widget Statistics not found.

There is an error in XML document (0, 0).X

Recent comments

Comment RSS