开发者

Adding 'required' and 'when' logic to work item transition steps

I've been doing really well with TFS for a few yrs now, but have run into something I can't seem to solve. I've added a custom field (Ipsum.UTC) on a bug work item (I'm using TFS 2010). I want to make this field required when the iteration path (e.g., Sprint 1, Sprint 2, Sprint 3, UAT, etc) equals "UAT". I want this to happen when a bug is first recorded, so I've setup the transition reasons - I could be using poor rules though.

Pseudo code: For a user recording a new bug work item; if user selects "UAT" from the iteration path list, the Ipsum.UTC field is req'd; else, the Ipsum.UTC field is not req'd.

Here's my XML that obviously doesn't work as expected; it's well formed, it just doesn't yield what I need:

<Transition from="" to="Untriaged">
  <REASONS>
    <DEFAULTREASON value="New defect reported">
      <开发者_如何转开发FIELDS>
        <FIELD refname="System.AssignedTo">
          <ALLOWEXISTINGVALUE />
          <EMPTY />
        </FIELD>
        <FIELD refname="Lorum.Build">
          <REQUIRED />
        </FIELD>
        <FIELD refname="Ipsum.UTC">
          <REQUIRED />
          <WHEN field="System.IterationPath" value="UAT">
            <MATCH pattern="UAT" />
          </WHEN>
        </FIELD>
      </FIELDS>
    </DEFAULTREASON>
  </REASONS>
  <FIELDS>
    <FIELD refname="Microsoft.VSTS.Common.BacklogPriority">
      <DEFAULT from="value" value="1000" />
    </FIELD>
  </FIELDS>
</Transition>


try this.

<FieldDefinition refname="Ipsum.UTC">
  <WHEN field="System.IterationPath" value="UAT">
    <REQUIRED />
  </WHEN>
</FieldDefinition>

you might wanna TFS power tools for easy XML generation. http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜