Artifact Uri Query - Query

Queries work items linked to a given list of artifact URI.

POST https://dev.azure.com/{organization}/{project}/_apis/wit/artifacturiquery?api-version=7.0

URI Parameters

Name In Required Type Description
organization
path True

string

The name of the Azure DevOps organization.

project
path

string

Project ID or project name

api-version
query True

string

Version of the API to use. This should be set to '7.0' to use this version of the api.

Request Body

Name Type Description
artifactUris

string[]

List of artifact URIs to use for querying work items.

Responses

Name Type Description
200 OK

ArtifactUriQueryResult

successful operation

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.work Grants the ability to read work items, queries, boards, area and iterations paths, and other work item tracking related metadata. Also grants the ability to execute queries, search work items and to receive notifications about work item events via service hooks.

Examples

Query work items for artifacts

Sample Request

POST https://dev.azure.com/fabrikam/_apis/wit/artifacturiquery?api-version=7.0

{
  "artifactUris": [
    "vstfs:///Git/Commit/3065bb47-8344-4370-982a-5183abf197fa%2F649107bd-ab35-4192-8584-601f64172f80%2F4800cfa0be564b1e606d6811e99e0380f765a9c4"
  ]
}

Sample Response

{
  "artifactUrisQueryResult": {
    "vstfs:///Git/Commit/3065bb47-8344-4370-982a-5183abf197fa%2F649107bd-ab35-4192-8584-601f64172f80%2F4800cfa0be564b1e606d6811e99e0380f765a9c4": [
      {
        "id": 1,
        "url": "https://dev.azure.com/fabrikam/_apis/wit/workItems/1"
      },
      {
        "id": 2,
        "url": "https://dev.azure.com/fabrikam/_apis/wit/workItems/2"
      }
    ]
  }
}

Definitions

Name Description
ArtifactUriQuery

Contains criteria for querying work items based on artifact URI.

ArtifactUriQueryResult

Defines result of artifact URI query on work items. Contains mapping of work item IDs to artifact URI.

ArtifactUriQuery

Contains criteria for querying work items based on artifact URI.

Name Type Description
artifactUris

string[]

List of artifact URIs to use for querying work items.

ArtifactUriQueryResult

Defines result of artifact URI query on work items. Contains mapping of work item IDs to artifact URI.

Name Type Description
artifactUrisQueryResult

object

A Dictionary that maps a list of work item references to the given list of artifact URI.