Skip to main content

Query By WIQL

QueryByWiql runs a Work Item Query Language query and returns the work items it matches.

It calls POST https://dev.azure.com/{organization}/{project}/{team}/_apis/wit/wiql, where {organization}, {project} and {team} come from the Organization Name, Project Name and Team Name fields.

The activity has four tabs: Configuration, Auth, Input, and Output.

Configuration

FieldRequiredDescription
NameOptionalName of the step, should be unique within this workflow.
DescriptionOptionalDescribe the purpose or function of this step.
API VersionRequiredSpecify the version of the API to use.
Organization NameRequiredEnter the name of the organization.
Project NameRequiredEnter the name of the project.
Team NameRequiredEnter the name of the team.
Time PrecisionOptionalSpecify whether to include time precision in the response.
Top LimitOptionalEnter the maximum number of items to return.

Time Precision and Top Limit are query parameters — timePrecision and $top respectively.

This is the only activity in the group that takes a Team Name; its endpoint is scoped to a team as well as a project.

Auth

FieldRequiredDescription
Auth TypeOptionalSelect the authentication method for the request. Options: No Auth, Basic, API Key, OAuth 2.
User NameOptionalUsername for Basic Authentication.
PasswordOptionalPassword for Basic Authentication.

Input

This activity is built on the REST Client, so the Input tab is the generic HTTP request rather than an Azure Boards-shaped payload. The WIQL query itself goes in the request body.

FieldRequiredData TypeDescription
TargetRequiredObjectThe HTTP request.

Output

The activity returns an httpResponse object.

FieldData TypeDescription
status.codeIntegerNumeric HTTP status code.
status.messageStringShort message associated with the HTTP status.
headersObjectHTTP response headers.
bodyObjectParsed body of the response — the query result.

The response body carries the query result:

FieldData TypeDescription
workItemsArrayThe work items returned by the query.
workItemRelationsArrayThe work item links returned by the query.
columnsArrayThe columns of the query.
sortColumnsArrayThe sort columns of the query.
queryTypeObjectThe type of the query.
queryResultTypeObjectThe result type.
asOfStringThe date the query was run in the context of.