The macro finds the work item ID for a specific work item type given a list of semicolon-separated work IDs.
The macro supports Team Build Attributes, as well as, its own macro specific attributes. Click on a link for more information on the common attributes.
The following table describes the macro specific attributes for the macro:
| Macro Specific Attributes | ||||||||
| Attribute | Description | Required | ||||||
| idList | A list of semicolon separated work IDs. | Yes | ||||||
| typeId |
The type ID for the target work item. Examples for work item type ID:
Specify either typeId or typeName, but not both. |
No | ||||||
| typeName |
The type display name for the target work item. Examples for work item name:
Specify either typeId or typeName, but not both. |
Yes | ||||||
| property | Name of the Ant property in which to return the ID of the target work item. If the target work item is not found, this property will not be set. | Yes | ||||||
/buildsystem/buildtoolkit/scripts/extensions/imports" folder of the EWM Build System Toolkit. To use the macro you must import the WorkItemMacros Ant script into your Ant script. To avoid hard-coding a location for the file, you may import WorkItemMacros into any Ant script by including the following Ant snippet in the script’s top-level section:
<import>
<javaresource name="scripts/extensions/imports/WorkItemMacros.xml"/>
</import>
Find the Epic work item in a string of work item IDs
<target name="main" description="main">
<FindWorkItemIdForWorkItemType
repositoryAddress="${repositoryAddress}"
userId="${userId}"
password="${password}"
idList="${team.enterprise.promotion.promotedWorkItemIds}"
typeId="com.ibm.team.apt.workItemType.epic"
property="foundId"/>
<echo>id: ${foundId}</echo>
</target>
An example Ant script is located in: "install_location/buildsystem/buildtoolkit/scripts/extensions/imports"