Share via


Rules Group (Work Item Type Definition Schema)

Specifies rules for the FIELD element.

<xs:group name="Rules">
    <xs:choice>
        <xs:element name="REQUIRED" type="PlainRule"/>
        <xs:element name="READONLY" type="PlainRule"/>
        <xs:element name="EMPTY" type="PlainRule"/>
        <xs:element name="FROZEN" type="PlainRule"/>
        <xs:element name="CANNOTLOSEVALUE" type="PlainRule"/>
        <xs:element name="NOTSAMEAS" type="FieldRule"/>
        <xs:element name="VALIDUSER" type="ValidUserRule"/>
        <xs:element name="ALLOWEXISTINGVALUE" type="EmptyRule"/>
        <xs:element name="MATCH" type="PatternRule"/>
        <xs:element name="ALLOWEDVALUES" type="ListRule"/>
        <xs:element name="SUGGESTEDVALUES" type="ListRule"/>
        <xs:element name="PROHIBITEDVALUES" type="ListRule"/>
        <xs:element name="DEFAULT" type="DefaultRule"/>
        <xs:element name="COPY" type="CopyRule"/>
        <xs:element name="SERVERDEFAULT" type="ServerDefaultRule"/>
    </xs:choice>
</xs:group>

Attributes and Elements

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

Attributes

None

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 the value of which 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 that contains a value to be copied into the current field.

SERVERDEFAULT Element (Work Item Type Definition Schema)

Optional element.

Specifies a server component that will provide the value for the field.

Parent Elements

None

Remarks

The Rules Group represents a choice. You can define a selection of rules for FIELD.

minOccurs: 1

maxOccurs: 1

Element Information

Namespace

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

Schema Name

Work Item Type Definition

Validation File

WorkItemTypeDefinition.xsd

Can be Empty

Not applicable

See Also

Tasks

Add a Rule to a Field

Other Resources

Setting Conditions on a Work Item Field

Work Item Type Definition Schema