Revisions - Get

Returns a fully hydrated work item for the requested revision

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

URI Parameters

Name In Required Type Description
id
path True

integer

int32
organization
path True

string

The name of the Azure DevOps organization.

revisionNumber
path True

integer

int32
project
path

string

Project ID or project name

api-version
query True

string

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

$expand
query

WorkItemExpand

Responses

Name Type Description
200 OK

WorkItem

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

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=6.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=6.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"
}

Definitions

Name Description
ReferenceLinks

The class to represent a collection of REST reference links.

WorkItem

Describes a work item.

WorkItemCommentVersionRef

Represents the reference to a specific version of a comment on a Work Item.

WorkItemExpand

The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }

WorkItemRelation

The class to represent a collection of REST reference links.

Name Type Description
links

object

The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.

WorkItem

Describes a work item.

Name Type Description
_links

ReferenceLinks

Link references to related REST resources.

commentVersionRef

WorkItemCommentVersionRef

Reference to a specific version of the comment added/edited/deleted in this revision.

fields

object

Map of field and values for the work item.

id

integer

The work item ID.

relations

WorkItemRelation[]

Relations of the work item.

rev

integer

Revision number of the work item.

url

string

WorkItemCommentVersionRef

Represents the reference to a specific version of a comment on a Work Item.

Name Type Description
commentId

integer

The id assigned to the comment.

createdInRevision

integer

[Internal] The work item revision where this comment was originally added.

isDeleted

boolean

[Internal] Specifies whether comment was deleted.

text

string

[Internal] The text of the comment.

url

string

version

integer

The version number.

WorkItemExpand

The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }

Name Type Description
all

string

Expands all.

fields

string

Fields work item expand.

links

string

Links work item expand.

none

string

Default behavior.

relations

string

Relations work item expand.

WorkItemRelation

Name Type Description
attributes

object

Collection of link attributes.

rel

string

Relation type.

url

string

Link url.