FIELD Element (Work Item Type Definition Schema)

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.

<FIELD refname="field reference name">
    <REQUIRED>…</REQUIRED>
    <READONLY>…</READONLY>
    <EMPTY>…</EMPTY>
    <FROZEN>…</FROZEN>
    <CANNOTLOSEVALUE>…</CANNOTLOSEVALUE>
    <NOTSAMEAS>…</NOTSAMEAS>
    <VALIDUSER>…</VALIDUSER>
    <ALLOWEXISTINGVALUE>…<ALLOWEXISTINGVALUE>
    <MATCH>…</MATCH>
    <ALLOWEDVALUES>…</ALLOWEDVALUES>
    <SUGGESTEDVALUES>…</SUGGESTEDVALUES>
    <PROHIBITEDVALUES>…</PROHIBITEDVALUES>
    <DEFAULT>…</DEFAULT>
    <COPY>…</COPY>
    <SERVERDEFAULT>…</SERVERDEFAULT>
    <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

Optional element.

You must define at least one of the child elements in this table.

Defines the field as required.

READONLY

Optional element.

You must define at least one of the child elements in this table.

Defines the field as read-only.

EMPTY

Optional element.

You must define at least one of the child elements in this table.

Defines the field as empty.

FROZEN

Optional element.

You must define at least one of the child elements in this table.

Defines the field as frozen, meaning that you can only change the field value to NULL.

CANNOTLOSEVALUE

Optional element.

You must define at least one of the child elements in this table.

Defines the field as cannot lose value, meaning that once you give the field a value, the field must always contain a non-NULL value.

NOTSAMEAS

Optional element.

You must define at least one of the child elements in this table.

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

VALIDUSER

Optional element.

You must define at least one of the child elements in this table.

Specifies a user or group who can modify the field.

ALLOWEXISTINGVALUE

Optional element.

You must define at least one of the child elements in this table.

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

MATCH

Optional element.

You must define at least one of the child elements in this table.

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

ALLOWEDVALUES

Optional element.

You must define at least one of the child elements in this table.

Defines a list of allowed values for the field.

SUGGESTEDVALUES

Optional element.

You must define at least one of the child elements in this table.

Defines a list of suggested values for the field.

PROHIBITEDVALUES

Optional element.

You must define at least one of the child elements in this table.

Defines a list of prohibited values for the field.

DEFAULT

Optional element.

You must define at least one of the child elements in this table.

Defines a default value for the field.

COPY

Optional element.

You must define at least one of the child elements in this table.

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

SERVERDEFAULT

Optional element.

You must define at least one of the child elements in this table.

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

WHEN

Optional element.

You must define at least one of the child elements in this table.

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

WHENNOT

Optional element.

You must define at least one of the child elements in this table.

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

WHENCHANGED

Optional element.

You must define at least one of the child elements in this table.

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

WHENNOTCHANGED

Optional element.

You must define at least one of the child elements in this table.

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

Parent Elements

Element Description

FIELDS

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

Remarks

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

Can Be Empty

No

See Also

Other Resources

Work Item Type Definition Schema
Defining Work Item Type Fields
Defining Field Rules