Compartilhar via


Revisions - Get

Retorna um item de trabalho totalmente hidratado para a revisão solicitada

GET https://dev.azure.com/{organization}/{project}/_apis/wit/workItems/{id}/revisions/{revisionNumber}?api-version=5.0
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workItems/{id}/revisions/{revisionNumber}?$expand={$expand}&api-version=5.0

Parâmetros de URI

Nome Em Obrigatório Tipo Description
id
path True

integer

int32
organization
path True

string

O nome da organização do Azure DevOps.

revisionNumber
path True

integer

int32
project
path

string

ID do projeto ou nome do projeto

api-version
query True

string

Versão da API a ser usada. Isso deve ser definido como '5.0' para usar essa versão da api.

$expand
query

WorkItemExpand

Respostas

Nome Tipo Description
200 OK

WorkItem

operação bem-sucedida

Segurança

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

Nome Description
vso.work Concede a capacidade de ler itens de trabalho, consultas, quadros, caminhos de área e iterações e outros metadados relacionados ao acompanhamento de itens de trabalho. Também concede a capacidade de executar consultas, pesquisar itens de trabalho e receber notificações sobre eventos de item de trabalho por meio de ganchos de serviço.

Exemplos

Get work item revision
Get work item revision (project scoped)

Get work item revision

Sample Request

GET https://dev.azure.com/fabrikam/_apis/wit/workItems/{id}/revisions/{revisionNumber}?api-version=5.0

Sample Response

{
  "id": 1,
  "rev": 2,
  "fields": {
    "System.WorkItemType": "Bug",
    "System.State": "New",
    "System.Reason": "New",
    "System.AssignedTo": {
      "displayName": "Jamal Hartnett",
      "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "_links": {
        "avatar": {
          "href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
        }
      },
      "id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "uniqueName": "fabrikamfiber4@hotmail.com",
      "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
    },
    "System.CreatedDate": "2017-09-04T02:08:16.6Z",
    "System.CreatedBy": {
      "displayName": "Jamal Hartnett",
      "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "_links": {
        "avatar": {
          "href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
        }
      },
      "id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "uniqueName": "fabrikamfiber4@hotmail.com",
      "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
    },
    "System.ChangedDate": "2017-09-04T02:28:56.253Z",
    "System.ChangedBy": {
      "displayName": "Jamal Hartnett",
      "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "_links": {
        "avatar": {
          "href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
        }
      },
      "id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "uniqueName": "fabrikamfiber4@hotmail.com",
      "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
    },
    "System.TeamProject": "MyAgilePro1",
    "System.AreaPath": "MyAgilePro1",
    "System.IterationPath": "MyAgilePro1\\Iteration 1",
    "System.Title": "Bug 1",
    "Microsoft.VSTS.Common.Priority": 2,
    "Microsoft.VSTS.Common.Severity": "3 - Medium",
    "Microsoft.VSTS.Common.ValueArea": "Business",
    "Microsoft.VSTS.Common.StateChangeDate": "2017-09-04T02:08:16.6Z",
    "System.Tags": ""
  },
  "_links": {
    "self": {
      "href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/workItems/1/revisions/2"
    },
    "workItemRevisions": {
      "href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/workItems/1/revisions"
    },
    "parent": {
      "href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/workItems/1"
    }
  },
  "url": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/workItems/1/revisions/2"
}

Get work item revision (project scoped)

Sample Request

GET https://dev.azure.com/fabrikam/Fabrikam-Fiber-Git/_apis/wit/workItems/{id}/revisions/{revisionNumber}?api-version=5.0

Sample Response

{
  "id": 1,
  "rev": 2,
  "fields": {
    "System.WorkItemType": "Bug",
    "System.State": "New",
    "System.Reason": "New",
    "System.AssignedTo": {
      "displayName": "Jamal Hartnett",
      "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "_links": {
        "avatar": {
          "href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
        }
      },
      "id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "uniqueName": "fabrikamfiber4@hotmail.com",
      "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
    },
    "System.CreatedDate": "2017-09-04T02:08:16.6Z",
    "System.CreatedBy": {
      "displayName": "Jamal Hartnett",
      "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "_links": {
        "avatar": {
          "href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
        }
      },
      "id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "uniqueName": "fabrikamfiber4@hotmail.com",
      "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
    },
    "System.ChangedDate": "2017-09-04T02:28:56.253Z",
    "System.ChangedBy": {
      "displayName": "Jamal Hartnett",
      "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "_links": {
        "avatar": {
          "href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
        }
      },
      "id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "uniqueName": "fabrikamfiber4@hotmail.com",
      "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
      "descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
    },
    "System.TeamProject": "MyAgilePro1",
    "System.AreaPath": "MyAgilePro1",
    "System.IterationPath": "MyAgilePro1\\Iteration 1",
    "System.Title": "Bug 1",
    "Microsoft.VSTS.Common.Priority": 2,
    "Microsoft.VSTS.Common.Severity": "3 - Medium",
    "Microsoft.VSTS.Common.ValueArea": "Business",
    "Microsoft.VSTS.Common.StateChangeDate": "2017-09-04T02:08:16.6Z",
    "System.Tags": ""
  },
  "_links": {
    "self": {
      "href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/workItems/1/revisions/2"
    },
    "workItemRevisions": {
      "href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/workItems/1/revisions"
    },
    "parent": {
      "href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/workItems/1"
    }
  },
  "url": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/workItems/1/revisions/2"
}

Definições

Nome Description
ReferenceLinks

A classe para representar uma coleção de links de referência REST.

WorkItem

Descreve um item de trabalho.

WorkItemExpand

Os parâmetros de expansão para atributos de item de trabalho. As opções possíveis são { None, Relations, Fields, Links, All }

WorkItemRelation

A classe para representar uma coleção de links de referência REST.

Nome Tipo Description
links

object

A exibição somente leitura dos links. Como os links de referência são somente leitura, só queremos expô-los como somente leitura.

WorkItem

Descreve um item de trabalho.

Nome Tipo Description
_links

ReferenceLinks

Vincular referências a recursos REST relacionados.

fields

object

Mapa de campos e valores para o item de trabalho.

id

integer

O ID do item de trabalho.

relations

WorkItemRelation[]

Relações do item de trabalho.

rev

integer

Número de revisão do item de trabalho.

url

string

WorkItemExpand

Os parâmetros de expansão para atributos de item de trabalho. As opções possíveis são { None, Relations, Fields, Links, All }

Nome Tipo Description
all

string

fields

string

links

string

none

string

relations

string

WorkItemRelation

Nome Tipo Description
attributes

object

Coleção de atributos de link.

rel

string

Tipo de relação.

url

string

Url do link.