copyWorkItem

The copyWorkItem retrieves attribute values from one EWM work item and copies them into another EWM work item. Value elements designate which work item attributes to retrieve and copy. The copyWorkItem task fetches both work items using the values specified for the fromWorkItemId and toWorkItemId attributes and sets the specified attributes in the toWorkItem with the values from the fromWorkItem. Store elements can be included when invoking copyWorkItem. Store elements are used to designate attributes to update in the toWorkItem thus combining the copy and updates processes into a single task.

The following table describes copyWorkItem attributes.

Attribute Description Required

repositoryAddress

Address of the team repository to use. The value of this attribute is typically ${repositoryAddress} because that property is built-in when the Jazz® Build Engine is used.

Yes

userId

User ID for authentication to the repository. Requires password or passwordFile to be set.

Yes

certificateFile

The path to the file that contains the user's login certificate for authentication. Requires password or passwordFile to be set. You can specify certificateFile or repositoriesFile, but not both.

No

password

Password for the user ID for authentication to the repository. Either password or passwordFile can be provided, but not both.

No

passwordFile

The password file to use for authentication to the connection. You can create a suitable password file by invoking the Jazz Build Engine with the -createPasswordFile argument. Only one password file can be specified. Either password or passwordFile can be provided, but not both.

No

smartCard

Use of the connected smart card for authentication (true or false). Requires userId to be set. For more information about smart card authentication, see Connecting to repositories and project areas.

No

failOnError

If true (default value), the task fails if it encounters an error. If false, some errors are ignored and the task is completed.

No

verbose

More message output. The default value is false.

No

fromWorkItemId The ID of the work item to copy attribute values from.

Yes

toWorkItemId The ID of the work item to copy attribute values to.

Yes

Value Elements

Value elements are specified within the copyWorkItem element. Value elements designate which attributes to copy from the input work item to the output work item. All Value elements are optional. At least one Value element is required. A name attribute is required for each Value element. The name attribute specifies the name of an EWM work item attribute.

The following table describes the Name Attribute of Value Element.

Value

Description

Required attributes

Optional attributes

approvals Copies work item approvals information    
category Copies work item category (Filed Against) value.    
comments Copies work item comments    
contextId Copies work item restricted access group name or project area name if an access group is not defined to the work item.    
correctedEstimate Copies work item corrected estimate.    
custom Copies work item custom attribute value.

fromCustom

toCustom

 
description Copies work item description.    
dueDate Copies work item due date.    
duration Copies work item duration.    
estimate Copies work item estimate.    
filedAgainst Copies work item category (Filed Against) value.    
foundIn Copies work item deliverable.    
links Copies work item links.    
modified Copies work item last modified date.    
modifiedBy Copies work item modifier.    
modifiedDate Copies work item last modified date.    
owndedBy Copies work item owner.    
owner Copies work item owner.    
plannedFor Copies work item target iteration.    
priority Copies work item priority.    
resolution Copies work item resolution state.    
resolutionDate Copies work item resolution date.    
resolvedBy Copies work item resolver.    
resolver Copies work item resolver.    
restrictedAccess Copies work item restricted access group name or project area name if an access group is not defined for the work item.    
severity Copies work item severity.    
startDate Copies work item start date.    
subscriptions Copies work item subscribers.    
summary Copies work item summary.    
tags Copies work item tags.    
target Copies work target iteration.    
timeSpent Copies work item time spent.    

The following table describes Required Attributes of Value Elements.

Name Value Description
fromCustom Attribute ID as defined in the process definition for the EWM project. Specifies the ID of the input custom attribute in the fromWorkItem.
toCustom Attribute ID as defined in the process definition for the EWM project. Specifies the ID of the output custom attribute in the toWorkItem.
Value Element Notes:
  • Blank cells signify that no value is required.
  • Default options are labeled with an asterisk (*).
  • The specified values must exist in both work items.
  • Custom elements must specify fromCustom and toCustom attributes that are the same type.
Store Element Notes
  • Refer to updateWorkItem documentation for more information on Store elements.

Example

Copy work item


<target name="main">
  <wi:copyWorkItem repositoryAddress="${repositoryAddress}" userId="${userId}" passwordFile="${passwordFile}" fromWorkItemId="352" toWorkItemId="358">
    <wi:value name="approvals"/>
    <wi:value name="category"/>
    <wi:value name="comments"/>
    <wi:value name="contextId"/>
    <wi:value name="correctedEstimate"/>
    <wi:value name="description"/>
    <wi:value name="dueDate"/>
    <wi:value name="duration"/>
    <wi:value name="estimate"/>
    <wi:value name="filedAgainst"/>
    <wi:value name="foundIn"/>
    <wi:value name="links"/>
    <wi:value name="modified"/>
    <wi:value name="modifiedBy"/>
    <wi:value name="modifiedDate"/>
    <wi:value name="ownedBy"/>
    <wi:value name="owner"/>
    <wi:value name="plannedFor"/>
    <wi:value name="priority"/>
    <wi:value name="resolution"/>
    <wi:value name="resolutionDate"/>
    <wi:value name="resolvedBy"/>
    <wi:value name="resolver"/>
    <wi:value name="restrictedAccess"/>
    <wi:value name="severity"/>
    <wi:value name="startDate"/>
    <wi:value name="subscriptions"/>
    <wi:value name="summary"/>
    <wi:value name="tags"/>
    <wi:value name="target"/>
    <wi:value name="timeSpent"/>
    <wi:store name="priority" value="High"/>
  </wi:copyWorkItem>
</target>