Link

Copy-TfsWorkItem

Creates a copy of a work item, optionally changing its type.


Table of Contents

  1. Syntax
  2. Description
  3. Parameters
  4. Inputs
  5. Outputs
  6. Related Links

Syntax

Copy-TfsWorkItem
    [-WorkItem] <object>
    [-Collection <object>]
    [-DestinationProject <object>]
    [-IncludeAttachments]
    [-IncludeLinks]
    [-NewType <object>]
    [-Passthru <string>]
    [-Project <object>]

[Go to top]

Description

Use this cmdlet to create a copy of a work item (using its latest saved state/revision data) that is of the specified work item type. By default, the copy retains the same type of the original work item, unless the Type argument is specified

[Go to top]

Parameters

-Collection

Specifies the URL to the Team Project Collection or Azure DevOps Organization to connect to, a TfsTeamProjectCollection object (Windows PowerShell only), or a VssConnection object. You can also connect to an Azure DevOps Services organizations by simply providing its name instead of the full URL. For more details, see the Get-TfsTeamProjectCollection cmdlet. When omitted, it defaults to the connection set by Connect-TfsTeamProjectCollection (if any).

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-DestinationProject

Specifies the team project where the work item will be copied into. When omitted, the copy will be created in the same team project of the source work item.

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-IncludeAttachments

Creates a duplicate of all attachments present in the source work item and adds them to the new work item.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-IncludeLinks

Creates a copy of all links present in the source work item and adds them to the new work item. Only the links are copied; linked artifacts themselves are not copied. In other words, both the original and the copy work items point to the same linked artifacts.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-NewType

Specifies the type of the new work item. When omitted, the type of the original work item is preserved.

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Passthru

Returns the results of the command. It takes one of the following values: Original (returns the original work item), Copy (returns the newly created work item copy) or None.

Type string
Position (Named)
Default Value Copy
Accept pipeline input False
Accept wildcard characters False

-Project

Specifies the source team project from where the work item will be copied. When omitted, it defaults to the team project of the piped work item (if any), or to the connection set by Connect-TfsTeamProject.

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-WorkItem (Aliases: id)

Specifies a work item. Valid values are the work item ID or an instance of Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.WorkItem.

Type object
Position 0
Default Value (N/A)
Accept pipeline input True (byvalue)
Accept wildcard characters False

Inputs

System.Object

Specifies a work item. Valid values are the work item ID or an instance of Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.WorkItem.

Outputs

Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.WorkItem