deleteBuildResults

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

This task supports the Team build attributes, Build Extensions debugging attributes, Build Extensions general attributes, and its own specific attributes.

The following table describes the specific attributes of the task.

Attribute Description Required
buildId Specify the ID of the build for which build results are to be deleted. Yes
preview Specify true to preview which build results are to be deleted. The default is false: the filtered build results are to be deleted. No
setDeletable Specify true to set nondeletable build results deletable. The default is false. So, nondeletable build results remain nondeletable, and are skipped. No

Result filtering elements

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

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

If multiple includeResult or excludeResult elements are specified, they are concatenated with OR. If a build result qualifies for any includeResult, it is deleted. If a build result qualifies for any excludeResult, it is not deleted.

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

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" includes all the build results for the builds that were 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 this attribute is not specified, both the team and personal builds are eligible. No
propertySet Specify the name of a build property. No
requestedBy Specify the user ID 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" includes all the build results from the builds that were 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 that are specified within an includeResult or excludeResult element are concatenated with AND for filtering. All the properties must be present and have the indicated value.

The following table describes the valid attribute values for the buildProperty element:

Attribute Description Required
name Specify the name of the build property. Yes
value Specify the value of the build property. Yes

Examples

The following code illustrates how to delete all the 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>
		                       
The following code illustrates how to delete all the build results for the specified build definition that contain the buildDefinitionId property 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>