STATE Element (Work Item Type Definition Schema)

Defines a valid workflow state for a type of work item. The STATE element can contain an optional FIELDS element that references rules and conditions that will be applied to a specific field when a work item of that type makes the transition to the state.

Schema Hierarchy

WITD Element (Work Item Type Definition Schema)

    WORKITEMTYPE Element (Work Item Type Definition Schema)

        WORKFLOW Element (Work Item Type Definition Schema)

            STATES Element (Work Item Type Definition Schema)

                STATE Element (Work Item Type Definition Schema)

<xs:element name="STATE" type="State" minOccurs="1" maxOccurs="unbounded"/>

<STATE value="value of state">
    <FIELDS>…</FIELDS>
</STATE>

Attributes and Elements

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

Attributes

Attribute

Description

value

Required State attribute.

The value of the state (for example, Active).

Child Elements

Element

Description

FIELDS Element (WORKFLOW)

Optional element.

Defines a collection of FIELD elements that specify conditions that will be applied to the field when a work item makes the transition to the new state.

Parent Elements

Element

Description

STATES Element (Work Item Type Definition Schema)

Required element.

Defines a collection of STATE elements that describe the valid states that the work item type can be in.

Remarks

STATE is a required child element of STATES.

minOccurs="1"

maxOccurs="unbounded"

When you specify the value of a field for a state, you use the FIELDS and FIELD elements for workflow. For more information, see FIELDS Element (WORKFLOW) and FIELD Element (WORKFLOW).

Example

The following example defines an Unapproved state.

<STATE value="Unapproved"></STATE>

The following example defines an Active state and specifies the values to be assigned to two fields.

<STATE value="Active">
      <FIELDS>
        <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
          <EMPTY />
        </FIELD>
        <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
... ... 
    <FIELDS>
</STATE>

Element Information

Namespace

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

Schema Name

Work Item Type Definition

Validation File

WorkItemTypeDefinition.xsd

Element Type

State Complex Type (Work Item Type Definition Schema)

Can Be Empty

Yes

See Also

Tasks

How to: Change the Workflow of a Work Item Type

Other Resources

Defining Work Item Workflow

Change History

Date

History

Reason

June 2010

Clarified that the FIELDS element is optional and references the FIELDS (WORKFLOW) element. element.

Customer feedback.