1
votes

We have a customized workflow in TFS 2017 and want to make a field mandatory (REQUIRED) when the work item is pulled to the kanban done column (state will not change!).
As far as I know only state changes may get REQUIRED rules.

I tried this but it does not work:

<FIELD name="AcceptanceCriteria" refname="Whiteduck.Scrumban.AcceptanceCriteria" type="HTML">
  <HELPTEXT>What criterias have to be fulfilled (what, how, restrictions, etc.).</HELPTEXT>
  <WHEN field="System.BoardColumnDone" value="true">
    <REQUIRED />
  </WHEN>
</FIELD>

For state changes this had worked:

<TRANSITION from="Analyze" to="Test">
  <REASONS>
    <DEFAULTREASON value="Test" />
  </REASONS>
  <FIELDS>
    ...
    <FIELD refname="Whiteduck.Scrumban.AcceptanceCriteria">
      <REQUIRED />
    </FIELD>
  </FIELDS>
</TRANSITION>

Any chances to apply a rule on a kanban done pull?

1

1 Answers

0
votes

To make a field mandatory in a work item you just need to add the REQUIRED rule for your field. It's not related to states changes only.

REQUIRED

Requires a user to specify a value for the field. Users cannot save a work item until they have assigned values to all required fields.

More details please refer this tutorial-- Require, read-only, and restrict values

You can specify these rules to take affect during a workflow transition or as child elements within a FIELD (Global workflow) element.

So this will not work when the work item is pulled to the kanban done column without a transition. Your requirement could not be achieved for now.