Share via


FieldValueCondition Complex Type (Work Item Type Definition Schema)

Defines the attributes and incorporates Rules for the WHEN and WHENNOT elements.

<xs:complexType name="FieldValueCondition">
    <xs:complexContent>
        <xs:extension base="FieldCondition">
            <xs:attribute name="value" type="typelib:Constant" use="required"/>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>

Attributes and Elements

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

Attributes

Attribute

Description

field

Required FieldCondition Complex Type (Work Item Type Definition Schema) attribute.

Specifies the field reference name of another field. In the WHEN element, identifies a field that must have a specified value for the rules in this element to be applied to the current field. In the WHENNOT element, identifies a field that must not have a specified value for the rules in this element to be applied to the current field.

The attribute type is typelib:ReferenceFieldName. Minimum length: 1; maximum length: 70.

Pattern value: ^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z0-9_]+)+$

Pattern value example: Company.Division.IssueType

For more information about reference names, see FIELD Element (WORKITEMTYPE Element).

value

Required attribute.

Specifies a value of the field identified by the field attribute. In the WHEN element, the rules contained in the element are applied when the field attribute value equals the value specified by this attribute. In the WHENNOT element, the rules contained in the element are applied when the field attribute value does not equal the value specified by this attribute. The attribute type is typelib:Constant. Maximum length: 255.

Child Elements

Element

Description

REQUIRED Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the current field must contain a value.

READONLY Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the current field is read-only.

EMPTY Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the current field must not contain a value.

FROZEN Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the current field is 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 Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the current field cannot be cleared or made empty after it has acquired a value.

NOTSAMEAS Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the value of the current field cannot match the value of a third field. You specify the third field in the NOTSAMEAS element.

VALIDUSER Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the list of allowed values must consist only of valid users of the system.

ALLOWEXISTINGVALUE Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the value of the current field that already exists will be allowed, even if it violates other rules. If the value of the current field is changed, this element does not apply.

MATCH Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the value of the current field must match the specified pattern.

ALLOWEDVALUES Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the current field must have a value that comes from the specified list of values. 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 Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the specified list contains suggested values for the current 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 Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the current field cannot contain any values in this list.

DEFAULT Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), this element specifies the default value for the current field.

COPY Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the value from a third field is automatically copied into the current field. You specify the third field in the COPY element.

SERVERDEFAULT Element (Work Item Type Definition Schema)

Optional Rules Group (Work Item Type Definition Schema) element.

Specifies that when the field that is identified by the field attribute has the specified value (in the WHEN Element), or does not have the specified value (in the WHENNOT Element), the current field takes its value from the specified server component. The server components are clock, which is the time when the work item is updated, and currentuser, which is the identity that updated the work item.

Parent Elements

None

Remarks

The FieldValueCondition Complex Type is the element type for the following elements:

WHEN Element (Work Item Type Definition Schema)

WHENNOT Element (Work Item Type Definition Schema)

FieldValueCondition is an extension of the FieldCondition Complex Type (Work Item Type Definition Schema).

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

Other Resources

Work Item Type Definition Schema

Working with Field Rules