none
TFS 2010 - default value for field in html format

    Întrebare

  • 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,

    5 martie 2012 11:15

Toate mesajele

  • 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


    5 martie 2012 16:58
  • The post is on web custom controls. 

    I wanted to know about default value in html format.

    6 martie 2012 14:11
  • 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


    6 martie 2012 15:10
  • 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

    6 martie 2012 15:47
  • 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

    • Propus ca răspuns de Jakcy Wong 24 august 2012 09:41
    6 martie 2012 16:27
  • 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.

    7 martie 2012 07:43
  • 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

    8 martie 2012 07:27
  • 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.

    11 martie 2012 09:10
  • 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

    12 martie 2012 07:02
  • 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.
    24 august 2012 09:42