The task deletes a filtered list of build results for the specified build.

Attributes

The task supports Team Build Attributes, Build Extensions Debugging Attributes, Build Extensions General Attributes, as well as, its own task specific attributes. Click on a link for more information on the common attributes.

The following table describes the task specific attributes for the task:

Task Specific Attributes
Attribute Description Required
buildId Specify the ID of the build for which build results are to be deleted. Yes
preview Specify true to preview what build results will be deleted. The default is false; the filtered build results will be deleted. No
setDeletable Specify true to set non-deletable build results deletable. The default is false; non-deletable build results will remain non-deletable, and therefore, will be skipped. No

Result Filtering Elements

The includeResult and excludeResult elements are specified within the element. Each includeResult element identifies filters for build results to include; the build results to delete. Each excludeResult element identifies filters for build results to exclude; the build results to keep. If no includeResult elements are specified, no build results will be deleted. No error is raised if includeResult elements find no eligible build results, or if, excludeResult elements skip all build results.

The attributes specified for filtering on includeResult and excludeResult elements are AND’ed. For example, if you specify personalBuild="true" and completed="2d" on an includeResult element, all build results for the specified build that are personal builds and 2 days old or more will be deleted.

If multiple includeResult or excludeResult elements are specified, they are OR’ed. If a build result qualifies for any includeResult, it will be deleted. If a build result qualifies for any excludeResult, it will not be deleted.

The following table describes the valid includeResult/excludeResult attribute values:

Result Filtering Elements
Attribute Description Required
buildState Specify one of the following build states:
  • CANCELED
  • COMPLETED
  • IN_PROGRESS
  • INCOMPLETE
  • NOT_STARTED
No
buildStatus Specify one of the following build statuses:
  • ERROR
  • INFO
  • OK
  • WARNING
No
complete Specify true or false. No
completed Specify the age of the build results to consider, as related to their completion time, in duration format (1w, 1d, 1h, 1m, 1s). For example: completed="2d" would include all build results for builds completed 2 or more days ago. No
deleteAllowed Specify true or false. No
label Specify the build result label. No
labelContains Specify a portion of the build result label. No
personalBuild Specify true for personal builds. Specify false for team builds. If not specified, both team and personal builds are eligible. No
propertySet Specify the name of a build property. No
requestedBy Specify the userid of the requestor. No
startTime Specify the age of the build results to consider, as related to their start time, in duration format (1w, 1d, 1h, 1m, 1s). For example: startTime="2d" would include all build results from builds started 2 or more days ago. No
tag Specify a build result tag. No
tagContains Specify a portion of a build result tag. No

Build Property Filtering Elements

The buildProperty element is specified within an includeResult or excludeResult element. Each buildProperty element identifies the name and value of a build property from the build result which must be present.

The buildProperty elements specified within an includeResult or excludeResult element are AND’ed when filtering; all properties must be present and have the indicated value.

Build Property Filtering Elements
Attribute Description Required
name Specify the name of the build property. Yes
value Specify the value of the build property. Yes

Examples

Delete all build results for the specified build definition that are personal builds older than 2 days:

<?xml version="1.0" encoding="UTF-8"?>
<project name="DeleteBuildResults" default="main" xmlns:xt="antlib:com.ibm.team.build.extensions.toolkit">
    
    <target name="main" description="main">
        
        <xt:deleteBuildResults
            repositoryAddress="${repositoryAddress}"
            userId="${userId}"
            password="${password}"
            buildId="${buildDefinition}">
            
            <xt:includeResult completed="2d" personalBuild="true"/>
            
        </xt:deleteBuildResults>
        
    </target>
    
</project>
    

Delete all build results for the specified build definition that contain the property buildDefinitionId with a value of ${buildDefinition}:

<?xml version="1.0" encoding="UTF-8"?>
<project name="deleteBuildResults" default="main" xmlns:xt="antlib:com.ibm.team.build.extensions.toolkit">
    
    <target name="main" description="main">
        
        <xt:deleteBuildResults
            repositoryAddress="${repositoryAddress}"
            userId="${userId}"
            password="${password}"
            buildId="${buildDefinition}">
            
            <xt:includeResult>
                <xt:buildProperty name="buildDefinitionId" value="${buildDefinition}"/>
            </xt:includeResult>
            
        </xt:deleteBuildResults>
        
    </target>
    
</project>