The task is used to identify tasks that the TeamTask macro invokes. The TeamTask macro is a wrapper method for calling tasks that support all Team Build login options; it handles all login option processing, as well as, all task-specific processing needs. The TeamTask macro greatly reduces the volume of code needed to support all of the login attributes and options for a Team Build task. The reference ID supplied by the task allows the TeamTask macro to support Ant tasks that are referenced by a namespace and is only required for tasks referenced by a namespace.
The task does not support any attributes.
One or more Task elements must be specified within the element. Task elements are used to identify which tasks will be called using the TeamTask macro. Each Task element must specify the namespace and name of the task to be called. A separate Task element is required for each uniquely named task to be called. At least one Task element is required.
The following table describes the valid Task element attributes and their options:
| Task Element Attributes | ||
| Attribute | Description | Required |
| id | The reference ID for the task. Each reference ID must be unique. | Yes |
Add a reference for the getWorkItem task, which is referenced by the "xt:" namespace, using "getWorkItemTaskReference" as the ID. This ID is subsequently passed to the TeamTask macro in the refid attribute:
<target name="main">
<xt:addReference>
<xt:getWorkItem id="getWorkItemTaskReference"/>
</xt:addReference>
<TeamTask
refid="getWorkItemTaskReference"
repositoryAddress="@{repositoryAddress}"
...
/>
</target>