Query Work Items task

Azure Pipelines | TFS 2018 | TFS 2017

Use this task in a build or release pipeline to ensure the number of matching items returned by a work item query is within the configured thresholds.

Can be used in only an agentless job of a release pipeline.

Note

In Microsoft Team Foundation Server (TFS) 2018 and previous versions, build and release pipelines are called definitions, service connections are called service endpoints, stages are called environments, and jobs are called phases.

Demands

None

YAML snippet

# Query Work Items
# Executes a work item query and checks for the number of items returned.
- task: queryWorkItems@0
  inputs:
    queryId: 
    #maxThreshold: '0' 
    #minThreshold: '0' 

Arguments

Parameter Comments
Query Required. Select a work item query within the current project. Can be a built-in or custom query.
Upper threshold Required. Maximum number of matching workitems for the query. Default value = 0
Lower threshold Required. Minimum number of matching workitems for the query. Default value = 0
Control options See Control options

Succeeds if minimum-threshold <= #-matching-workitems <= maximum-threshold

For more information about using this task, see Approvals and gates overview.

Open source

This task is open source on GitHub. Feedback and contributions are welcome.