Automatically change a field based on another in TFS

牧云@^-^@ 提交于 2020-01-04 05:20:09

问题


Is it possible to change a value of field based on the value of another field in TFS?

What I'm trying to do is, when the value of the Story Points field changes, update automatically another field with the correspondent T-Shirt size value.

For example, we are using power of 2 values to represent the story points; So, for a 1 points story it would correspond a t-shirt value of XS, for a 2 points story a t-shirt value of S, and so on.

Is this possible?


回答1:


Use a combination of WHEN conditions and COPY rules:

<FIELD name="StoryPoints Size" refname="Custom.StoryPoints.Size" type="String">
  <WHEN field="Microsoft.VSTS.Scheduling.StoryPoints" value="1">
    <COPY from="value" value="XS" />
  </WHEN>
  <WHEN field="Microsoft.VSTS.Scheduling.StoryPoints" value="2">
    <COPY from="value" value="S" />
  </WHEN>
  <WHEN field="Microsoft.VSTS.Scheduling.StoryPoints" value="3">
    <COPY from="value" value="M" />
  </WHEN>
  <WHEN field="Microsoft.VSTS.Scheduling.StoryPoints" value="4">
    <COPY from="value" value="L" />
  </WHEN>         
  <WHEN field="Microsoft.VSTS.Scheduling.StoryPoints" value="5">
    <COPY from="value" value="XL" />
  </WHEN>         
</FIELD>



回答2:


You'll find all you need here on the MSDN and more specifically the section called:

"Defining a Field When the User Changes Another Field (WHENCHANGED)".



来源:https://stackoverflow.com/questions/10790619/automatically-change-a-field-based-on-another-in-tfs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!