Embedding Text in TFS Description Field
I have a TFS Question regarding the Description field. Currently the TFS Description field is an empty field in which users add any info. Is it possible to embed some type of text?
Example: When creating a new bug, TFS Description field is empty. Instead I want to have the following populated within the description field.
- Configuration and Logs
- Version and Environment
- Reproduction Steps
- Screenshots or related files (certificates, etc.) are attached
I assume it would be similar to using the Default Value tags only that it would be done when the bug is created.
I figured out the solution.
My current description field is a plain text field so I set the field with a default value of X. I did this in the initial transition to when creating the Bug Work Item.
Then, I exported the Work Item XML and searching for:
Right under it, I found the Default Value tag, it looked like this:
<DEFAULT from="value" value="1. Configuration and Logs 2. Version and Environment" />
I proceeded to add the xml breakline tag
to separate the lines. The new Default would look like this
<DEFAULT from="value" value="1. Configuration and Logs
2. AW Version and Environment" />
Finally, I imported the modified Bug.xml and tested it. Now whenever I open a new bug, these lines will be visible in the Description field
I have not been able to find any support for this on current releases of TFS (e.g. 2015), so I went ahead figured this out myself.
This information was tested and working on TFS 2015, I assume it should on 2013 as well, I just cannot test that.
To start and understand I'll clear couple things up.
The bug WIT steps to reproduce field is a html field.
XML forms have special markup for certain characters, that are in a string for example.
& = & < = < > = > " = " ' = '
Example for this would be to add string value of the word "Reproduction Steps" in bold. The bug WIT steps to reproduce field is HTML, so we'll add HTML markup using the special XML markup.
Would look like this inside the bug.xml:
<b> Reproduction Steps </b>
Now putting this all together, you'll want to export the bug WIT so you can edit the bug.xml and import back to project when done.
Tools > Process Editor > Work Item Types > Export WIT
Then you'll find this line in the bug.xml
<FIELD name="Repro Steps" refname="Microsoft.VSTS.TCM.ReproSteps" type="HTML"/>
You'll edit this to make it look like what is below, to embed the text inside the steps to reproduce bug field.
<FIELD name="Repro Steps" refname="Microsoft.VSTS.TCM.ReproSteps" type="HTML"> <DEFAULT from="value" value="All the embedded html/xml text will go here" /> </FIELD>
Final product with requested text from OP will look like this.
<FIELD name="Repro Steps" refname="Microsoft.VSTS.TCM.ReproSteps" type="HTML"> <DEFAULT from="value" value="<b> Configuration and Logs </b> <br/> <b> Reproduction Steps</b> <br/> <b> Device/Environment</b> <br/> <b> Screenshots or related files (certificates, etc.) are attached</b> <br/>" /> </FIELD>
Once you save that bug.xml, you'll want to go back into visual studio and import it.
Tools > Process Editor > Work Item Types > Import WIT