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
| Field | Required | Description |
|---|---|---|
| Name | Optional | Name of the step, should be unique within this workflow. |
| Description | Optional | Describe the purpose or function of this step. |
| API Version | Required | Specify the version of the API to use. |
| Organization Name | Required | Enter the name of the organization. |
| Project Name | Required | Enter the name of the project. |
| Team Name | Required | Enter the name of the team. |
| Time Precision | Optional | Specify whether to include time precision in the response. |
| Top Limit | Optional | Enter 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
| Field | Required | Description |
|---|---|---|
| Auth Type | Optional | Select the authentication method for the request. Options: No Auth, Basic, API Key, OAuth 2. |
| User Name | Optional | Username for Basic Authentication. |
| Password | Optional | Password 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.
| Field | Required | Data Type | Description |
|---|---|---|---|
| Target | Required | Object | The HTTP request. |
Output
The activity returns an httpResponse object.
| Field | Data Type | Description |
|---|---|---|
| status.code | Integer | Numeric HTTP status code. |
| status.message | String | Short message associated with the HTTP status. |
| headers | Object | HTTP response headers. |
| body | Object | Parsed body of the response — the query result. |
The response body carries the query result:
| Field | Data Type | Description |
|---|---|---|
| workItems | Array | The work items returned by the query. |
| workItemRelations | Array | The work item links returned by the query. |
| columns | Array | The columns of the query. |
| sortColumns | Array | The sort columns of the query. |
| queryType | Object | The type of the query. |
| queryResultType | Object | The result type. |
| asOf | String | The date the query was run in the context of. |