WHENCHANGED Element (Work Item Type Definition Schema)
Specifies a condition under which to apply one or more rules to the current field. The rules apply to the current field when the value of another field changes. The parent element defines the current field.
<xs:element name="WHENCHANGED" type="FieldCondition"/>
Attributes and Elements
The following sections describe the attribute and child elements that define the WHENCHANGED element. They also describe parent elements that define how the WHENCHANGED element is applied. You must define at least one child element.
Attributes
Attribute |
Description |
---|---|
field |
Required attribute. Identifies a field that must change for the rules in this element to be applied to the current field (the field that contains the WHENCHANGED Element). You specify this attribute by the field reference name. For more information about reference names, see FIELD Element (WORKITEMTYPE Element). |
Child Elements
Element |
Description |
---|---|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, the current field (the field that contains the WHENCHANGED Element) must have a value. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, the current field is read-only. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, the current field must be empty. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, 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. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute is not changed, the current field cannot be cleared or made empty after it has acquired a value. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, the value of the current field cannot match the value of a third field. You specify the third field in the NOTSAMEAS element. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, the list of allowed values must consist only of valid users of the system. |
|
ALLOWEXISTINGVALUE Element (Work Item Type Definition Schema) |
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, 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. |
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, the value of the current field must match the specified pattern. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, 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. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, 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. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, the current field cannot contain any values in this list. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, the specified value is the default value for the current field. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, the value from a third field is automatically copied into the current field. You specify the third field in the COPY element. |
|
Optional element. Specifies that when the value of the field that is identified by the field attribute changes, the current field uses the 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
Element |
Description |
---|---|
Required element. 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. |
|
Required element. Defines a work item field and specifies the rules and conditions that apply to it. |
Remarks
WHENCHANGED is an optional child element of FIELD (Work Item Type Definition Schema) and FIELD (WORKITEMTYPE element).
Example
<WHENCHANGED field="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>
</WHENCHANGED>
Element Information
Namespace |
https://schemas.microsoft.com/VisualStudio/2005/workitemtracking/typedef |
Schema Name |
Work Item Type Definition |
Validation File |
WorkItemTypeDefinition.xsd |
Element Type |
FieldCondition Complex Type (Work Item Type Definition Schema) |
Can Be Empty |
No |