FIELD Element (WORKFLOW)

References a work item field definition and the rules and conditions that apply to the field. The reference is based on the STATE, TRANSITION, DEFAULTREASON, or REASON element that its parent FIELDS element is a child of.

<xs:element name="FIELD" type="FieldReference" minOccurs="1" maxOccurs="unbounded"/>

<FIELD refname="field reference name">
   <ALLOWEDVALUES> . . . </ALLOWEDVALUES>
   <ALLOWEXISTINGVALUE />
   <CANNOTLOSEVALUE />
   <COPY />
   <DEFAULT />
   <EMPTY />
   <FROZEN />
   <MATCH />
   <NOTSAMEAS />
   <PROHIBITEDVALUES /> . . . </PROHIBITEDVALUES>
   <READONLY />
   <SERVERDEFAULT />
   <SUGGESTEDVALUES /> . . . </SUGGESTEDVALUES>
   <VALIDUSER />
   <WHEN>> . . . </WHEN>
   <WHENNOT> . . . </WHENNOT>
   <WHENCHANGED> . . . </WHENCHANGED>
   <WHENNOTCHANGED> . . . </WHENNOTCHANGED>
<FIELD>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

refname

Required FieldReference attribute.

The reference name of the field where the rules and conditions are applied. The reference name must match the reference name defined in the field definition's FIELD element. For more information, see FIELD Element (WORKITEMTYPE Element).

Child Elements

Element

Description

REQUIRED Element (Work Item Type Definition Schema)

Optional element.

Defines the field as required.

READONLY Element (Work Item Type Definition Schema)

Optional element.

Defines the field as read-only.

EMPTY Element (Work Item Type Definition Schema)

Optional element.

Defines the field as empty.

FROZEN Element (Work Item Type Definition Schema)

Optional element.

Defines the field as frozen. A frozen field cannot be changed to any non-empty value after changes are committed. However, you can manually clear the field, save the work item, and then specify a different value.

CANNOTLOSEVALUE Element (Work Item Type Definition Schema)

Optional element.

Defines the field as cannot lose value. This means that after the current field has acquired a value, it cannot be cleared or made empty.

NOTSAMEAS Element (Work Item Type Definition Schema)

Optional element.

Specifies another field as the source of a value that cannot be identical to the value of the current field.

VALIDUSER Element (Work Item Type Definition Schema)

Optional element.

Specifies that the list of allowed values must consist only of valid users of the system.

ALLOWEXISTINGVALUE Element (Work Item Type Definition Schema)

Optional element.

Defines the field as allow existing value. This means that the field values that already exist will be allowed, even if they are not valid. All new field values must be valid.

MATCH Element (Work Item Type Definition Schema)

Optional element.

Defines a pattern for the field that the field value must match.

ALLOWEDVALUES Element (Work Item Type Definition Schema)

Optional element.

Defines a list of allowed values for the field. Allowed values are values that are available for selection in a field list on work item forms and in the query builder. You must select from one of these values.

SUGGESTEDVALUES Element (Work Item Type Definition Schema)

Optional element.

Defines a list of suggested values for the field. Suggested values are values that are available for selection in a field list on work item forms and in the query builder. You can enter other values in addition to the ones in the list.

PROHIBITEDVALUES Element (Work Item Type Definition Schema)

Optional element.

Defines a list of prohibited values for the field.

DEFAULT Element (Work Item Type Definition Schema)

Optional element.

Defines a default value for the field.

COPY Element (Work Item Type Definition Schema)

Optional element.

Specifies another field as the source of the value to be copied into the current field.

SERVERDEFAULT Element (Work Item Type Definition Schema)

Optional element.

Specifies a server component as the source of the value for this field.

WHEN Element (Work Item Type Definition Schema)

Optional element.

Specifies one or more rules to apply to the current field when another field has a specific value.

WHENNOT Element (Work Item Type Definition Schema)

Optional element.

Applies one or more rules to the current field when another field does not have a specific value.

WHENCHANGED Element (Work Item Type Definition Schema)

Optional element.

Applies one or more rules to the current field when a specific field is changed.

WHENNOTCHANGED Element (Work Item Type Definition Schema)

Optional element.

Applies one or more rules to the current field when a specific field is not changed.

Parent Elements

Element

Description

FIELDS Element (WORKFLOW)

A collection of FIELD elements that reference the field definitions contained in the work item type.

Remarks

You must define at least one child element for the FIELD (Work Item Type Definition Schema) Element.

FIELD is a required child element of FIELDS.

minOccurs="1"

maxOccurs="unbounded"

Element Information

Namespace

https://schemas.microsoft.com/VisualStudio/2005/workitemtracking/typedef

Schema Name

Work Item Type Definition

Validation File

WorkItemTypeDefinition.xsd

Element Type

FieldReference Complex Type (Work Item Type Definition Schema)

Can Be Empty

No

See Also

Other Resources

Work Item Type Definition Schema

Defining Work Item Type Fields