问题
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