TFS 2010 转换验证到力场更改

TFS 2010 转换验证到力场更改

我在用着特福斯2010,我想添加转换验证来表明必须更改字段值。即转换后的值不能与状态转换前的值相同。阅读文档后,我不知道该怎么做。有什么建议吗?

答案1

我通过改编这篇文章找到了答案:http://blogs.msdn.com/b/teams_wit_tools/archive/2009/02/07/work-item-rules-workarounds-validating-area-path.aspx

步骤 1:设置验证隐藏字段

<FIELD name="Hidding Validation" refname="DavePotts.HiddenValidation" type="String">
    <HELPTEXT>Hidden validation field</HELPTEXT>
    <PROHIBITEDVALUES expanditems="true">
      <LISTITEM value="This field must be changed on a state transition" />
    </PROHIBITEDVALUES>
    <COPY from="value" value="No Errors" />
</FIELD>

步骤2:设置转换字段约束,若未发生改变则触发禁止值

<TRANSITION from="initial" to="final">
    <FIELDS>
        <!-- This block forces the DavePotts.FieldYouWantToChange field to be changed in value on transition -->
        <FIELD refname="DavePotts.HiddenValidation">
           <WHENNOTCHANGED field="DavePotts.FieldYouWantToChange">
              <COPY from="value" value="This field must be changed on a state transition" />
           </WHENNOTCHANGED>
        </FIELD>            
    </FIELDS>
</TRANSITION>

相关内容