none
TFS 2010 - default value for field in html format

    Question

  • I set a default value for a field in html format (I needed a template for the repro steps field, title in bold then steps to reproduce (with automatic numbering)).

    The template is displayed correctly in TFS and TFS web, but I can't save new bugs in the web and I can't edit existing work items in the web.

    Is there a way to set default value for the web in html format?

    Or set default value only for win forms layout (ignore the default value in web)?

    Thanks,

    Monday, March 05, 2012 11:15 AM

All replies

  • The below post talks about how to customize work items controls for TWA (TFS 2010).

    http://www.ewaldhofman.nl/post/2010/08/10/Create-custom-work-item-control-for-TFS-Web-Access-2010-(TWA).aspx


    Please remember to mark the replies as answers if they help Thanks, --Kuldeep


    Monday, March 05, 2012 4:58 PM
  • The post is on web custom controls. 

    I wanted to know about default value in html format.

    Tuesday, March 06, 2012 2:11 PM
  • Billy_mk

    I've tried what you said and it is working fine on the TWA and in the Team Explorer.

    I've created a new work item and created a default value in the Repro Step field. Saved the work item and then used a value from the TFS database: dbo.WorkItemsLongText to copy and paste the value to the WorkItem Editor as a default value.

    What are your steps to create a default value and what value exactly are you using?


    Please remember to mark the replies as answers if they help. --- Success, Damir


    • Edited by Damir Varga Tuesday, March 06, 2012 3:11 PM
    Tuesday, March 06, 2012 3:10 PM
  • Hi,

    I'm editing the work item's xml file:

    <FIELD name="Scenario" refname="xxx.Scenario" type="HTML">
            <REQUIRED />
            <DEFAULT from="value" value="&lt;P&gt;&lt;STRONG&gt;Scenario steps:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Bug:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expected results:&lt;/STRONG&gt;&lt;/P&gt;" />
            <HELPTEXT>The scenario of reproducing the bug</HELPTEXT>
          </FIELD>

    the text displayed is:

    Scenario steps:


    The Bug:

    Expected results:

    even if I set only short string like 

    <DEFAULT from="value" value="&lt;P&gt;&lt;STRONG&gt;Scenario steps:&lt;/STRONG&gt;&lt;/P&gt;" />

    I can't seem to save the work item in TWA.

    Thanks

    Tuesday, March 06, 2012 3:47 PM
  • Billy,

    I'm using following values and it is working fine:

    <FieldDefinition refname="Microsoft.VSTS.TCM.ReproSteps" name="Repro Steps" type="HTML">
      <DEFAULT from="value" value="&lt;P&gt;&lt;STRONG&gt;Repro steps&lt;/STRONG&gt;&lt;/P&gt;&#xA;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&#xA;&lt;OL&gt;&#xA;&lt;LI&gt;Hello 1&lt;/LI&gt;&#xA;&lt;LI&gt;Hello 2&lt;/LI&gt;&#xA;&lt;LI&gt;Hello 3&lt;/LI&gt;&lt;/OL&gt;" />
      <HELPTEXT>How to see the bug. End by contrasting expected with actual behavior.</HELPTEXT>
    </FieldDefinition>

    Maybe it is issue with the Internet Browser? What type/version are you using?

    Please remember to mark the replies as answers if they help. --- Success, Damir

    • Proposed as answer by Jakcy Wong Friday, August 24, 2012 9:41 AM
    Tuesday, March 06, 2012 4:27 PM
  • Damir,

    Thank you for your response, I'm using explorer 8 and chrome and in both browsers the bug items are not saved if I add the default value.

    any ideas?

    Thanks.

    Wednesday, March 07, 2012 7:43 AM
  • Hi Bill,

    Thanks for your post.

    I also reproduced this scenario in my VS 2010 and TFS Web Access too, both create and save work item fine.

    Have you tried to create and save that work item using TFS Web Access on other clients? Please try that. And what’s the detailed message you occurred when you can’t save it in Web Access.

    If you have any further research of  this issue, please share your experience here.  


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, March 08, 2012 7:27 AM
  • Hi,

    I tried to save the work item from several clients but the work items are not saved.

    I don't get any error message but the "Saving" message is displayed, and if I don't close it manually it's stays for hours.

    If I remove the default value the items are saved.

    Sunday, March 11, 2012 9:10 AM
  • Hi Bill,

    Thanks for your reply.

    Please try to create and add(using TFS Power Tools) the following field in your Work Item Type, then test this field in VS and TFS Web Access separately.

    <FieldDefinition refname="demo.html" name="HTML" type="HTML">

      <REQUIRED />

      <DEFAULT from="value" value="&lt;P&gt;Expect result:&lt;/P&gt; &lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp; Steps&lt;/P&gt; &lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp; Steps&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;" />

    </FieldDefinition>


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us

    Monday, March 12, 2012 7:02 AM
  • Billy,

    I'm using following values and it is working fine:

    <FieldDefinition refname="Microsoft.VSTS.TCM.ReproSteps" name="Repro Steps" type="HTML">
      <DEFAULT from="value" value="&lt;P&gt;&lt;STRONG&gt;Repro steps&lt;/STRONG&gt;&lt;/P&gt;&#xA;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&#xA;&lt;OL&gt;&#xA;&lt;LI&gt;Hello 1&lt;/LI&gt;&#xA;&lt;LI&gt;Hello 2&lt;/LI&gt;&#xA;&lt;LI&gt;Hello 3&lt;/LI&gt;&lt;/OL&gt;" />
      <HELPTEXT>How to see the bug. End by contrasting expected with actual behavior.</HELPTEXT>
    </FieldDefinition>

    Maybe it is issue with the Internet Browser? What type/version are you using?

    Please remember to mark the replies as answers if they help. --- Success, Damir

    It woks well for TWA and Team Explorer.
    Friday, August 24, 2012 9:42 AM