WorkItem.Copy Method (WorkItemType, WorkItemCopyFlags)

Creates a copy of this WorkItem instance that is of the specified WorkItemType.

Namespace:  Microsoft.TeamFoundation.WorkItemTracking.Client
Assembly:  Microsoft.TeamFoundation.WorkItemTracking.Client (in Microsoft.TeamFoundation.WorkItemTracking.Client.dll)

public WorkItem Copy(
	WorkItemType targetType,
	WorkItemCopyFlags flags
)

Parameters

targetType
Type: Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemType

The type of the target work item.

flags
Type: Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemCopyFlags

Flags that specify items to copy in addition to fields.

Return Value

Type: Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem
A new WorkItem instance of the specified WorkItemType that is a copy of this WorkItem instance.

ExceptionCondition
ArgumentNullException

Thrown when targetType is null.

The last known saved state of this WorkItem instance is copied.

Show: