Share via


CopyRule Complex Type (Work Item Type Definition Schema)

Defines attributes for use by the COPY Element.

<xs:complexType name="CopyRule">
    <xs:complexContent>
        <xs:extension base="PlainRule">
            <xs:attribute name="from" type="CopyFrom" use="required"/>
            <xs:attribute name="value" type="typelib:Constant"/>
            <xs:attribute name="field" type="typelib:ReferenceFieldName"/>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>

Attributes and Elements

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

Attributes

Attribute

Description

for

Optional PlainRule Complex Type (Work Item Type Definition Schema) attribute.

The name of a user or group to whom this rule applies. The attribute type is typelib:IdentityName. Minimum length: 1; maximum length: 255

Pattern value: ^[^\\]+\\[^\\]+$

Pattern value example: Domain\userID

not

Optional PlainRule Complex Type (Work Item Type Definition Schema) attribute.

The name of a user or group to whom this rule does not apply. The attribute type is typelib:IdentityName. Minimum length: 1; maximum length: 255

Pattern value: ^[^\\]+\\[^\\]+$

Pattern value example: Domain\userID

from

Required attribute.

The source of the value. Specifies the source of the default value from which to copy. Values are as follow:

  • value: Copies the value specified by the value attribute.

  • field: Copies the value specified by the field attribute.

  • clock: Copies the time from the system clock.

  • currentuser: Copies the currently logged-on user.

If you specify value or field, you must also include the value or field attribute, respectively.

value

Optional attribute.

The value to copy. The attribute type is typelib:Constant. Minimum length: 1; maximum length: 255.

field

Optional attribute.

The reference name of the field to copy. The reference name must match the reference name that is defined in the field definition FIELD element. 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

NoteNote
If the work item is in the process of being changed, the COPY element rule may select either the current or previous value from the source field.

For more information, see FIELD Element (WORKITEMTYPE Element).

Child Elements

None

Parent Elements

None

Remarks

The CopyRule Complex Type is the COPY Element (Work Item Type Definition Schema) type. It is an extension of the PlainRule 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

Concepts

Field Rules, Defaults, Qualifiers, Lists, Actions, and Matching Patterns

Other Resources

Setting Conditions on a Work Item Field