Work Items - Get Work Item Template
Returns a single work item from a template.
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/${type}?api-version=6.1-preview.3
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/${type}?fields={fields}&asOf={asOf}&$expand={$expand}&api-version=6.1-preview.3
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
organization
|
path | True |
string |
The name of the Azure DevOps organization. |
project
|
path | True |
string |
Project ID or project name |
type
|
path | True |
string |
The work item type name |
api-version
|
query | True |
string |
Version of the API to use. This should be set to '6.1-preview.3' to use this version of the api. |
$expand
|
query |
The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. |
||
as
|
query |
string date-time |
AsOf UTC date time string |
|
fields
|
query |
string |
Comma-separated list of requested fields |
Responses
Name | Type | Description |
---|---|---|
200 OK |
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
Returns a single work item from a template
Sample Request
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/${type}?api-version=6.1-preview.3
Sample Response
{
"fields": {
"System.WorkItemType": "Bug",
"System.AreaPath": "Test Project",
"System.TeamProject": "Test Project",
"System.IterationPath": "Test Project",
"System.State": "New",
"System.Reason": "New",
"Microsoft.VSTS.Common.StateChangeDate": "1753-01-01T00:00:00Z",
"System.ChangedBy": {
"displayName": "Fabricam Zhang",
"url": "https://app.vssps.visualstudio.com/Accf03646-3dbb-4c84-91f3-739a6c8797a1/_apis/Identities/5f499b36-f993-6330-9295-1abf1a669337",
"_links": {
"avatar": {
"href": "https://dev.azure.com/fabricam3/_apis/GraphProfile/MemberAvatars/msa.NWY0OTliMzYtZjk5My03MzMwLTkyOTUtMWFiZjFhNjY5MzM3"
}
},
"id": "5f499b36-f993-6330-9295-1abf1a669337",
"uniqueName": "fabricam2@outlook.com",
"imageUrl": "https://dev.azure.com/fabricam3/_api/_common/identityImage?id=5f499b36-f993-6330-9295-1abf1a669337",
"descriptor": "msa.NWY0OTliMzYtZjk5My03MzMwLTkyOTUtMWFiZjFhNjY5MzM3"
},
"System.CreatedBy": {
"displayName": "Fabricam Zhang",
"url": "https://app.vssps.visualstudio.com/Accf03646-3dbb-4c84-91f3-739a6c8797a1/_apis/Identities/5f499b36-f993-6330-9295-1abf1a669337",
"_links": {
"avatar": {
"href": "https://dev.azure.com/fabricam3/_apis/GraphProfile/MemberAvatars/msa.NWY0OTliMzYtZjk5My03MzMwLTkyOTUtMWFiZjFhNjY5MzM3"
}
},
"id": "5f499b36-f993-6330-9295-1abf1a669337",
"uniqueName": "fabricam2@outlook.com",
"imageUrl": "https://dev.azure.com/fabricam3/_api/_common/identityImage?id=5f499b36-f993-6330-9295-1abf1a669337",
"descriptor": "msa.NWY0OTliMzYtZjk5My03MzMwLTkyOTUtMWFiZjFhNjY5MzM3"
},
"Microsoft.VSTS.Common.Priority": 2,
"Microsoft.VSTS.Common.Severity": "3 - Medium",
"Microsoft.VSTS.Common.ValueArea": "Business"
},
"_links": {
"workItemType": {
"href": "https://dev.azure.com/fabricam3/c1b5ee8b-7c3f-4e7d-bb53-ce022cf5af4b/_apis/wit/workItemTypes/Bug"
},
"fields": {
"href": "https://dev.azure.com/fabricam3/c1b5ee8b-7c3f-4e7d-bb53-ce022cf5af4b/_apis/wit/fields"
}
},
"url": "https://dev.azure.com/fabricam3/c1b5ee8b-7c3f-4e7d-bb53-ce022cf5af4b/_apis/wit/workItems"
}
Definitions
Name | Description |
---|---|
Reference |
The class to represent a collection of REST reference links. |
Work |
Describes a work item. |
Work |
Represents the reference to a specific version of a comment on a Work Item. |
Work |
The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All } |
Work |
ReferenceLinks
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 |
Link references to related REST resources. |
|
commentVersionRef |
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 |
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. |
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for