Work Items - Get Work Items Batch
Gets work items for a list of work item ids (Maximum 200)
POST https://dev.azure.com/{organization}/{project}/_apis/wit/workitemsbatch?api-version=6.1-preview.1
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 '6.1-preview.1' to use this version of the api. |
Request Body
Name | Type | Description |
---|---|---|
$expand |
The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All } |
|
asOf |
string |
AsOf UTC date time string |
errorPolicy |
The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}. |
|
fields |
string[] |
The requested fields |
ids |
integer[] |
The requested work item ids |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Work |
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 list of work items for specific fields
Sample Request
POST https://dev.azure.com/fabrikam/_apis/wit/workitemsbatch?api-version=6.1-preview.1
{
"ids": [
297,
299,
300
],
"fields": [
"System.Id",
"System.Title",
"System.WorkItemType",
"Microsoft.VSTS.Scheduling.RemainingWork"
]
}
Sample Response
{
"count": 3,
"value": [
{
"id": 297,
"rev": 1,
"fields": {
"System.Id": 297,
"System.WorkItemType": "Product Backlog Item",
"System.Title": "Customer can sign in using their Microsoft Account"
},
"url": "https://dev.azure.com/fabrikam/_apis/wit/workItems/297"
},
{
"id": 299,
"rev": 7,
"fields": {
"System.Id": 299,
"System.WorkItemType": "Task",
"System.Title": "JavaScript implementation for Microsoft Account",
"Microsoft.VSTS.Scheduling.RemainingWork": 4
},
"url": "https://dev.azure.com/fabrikam/_apis/wit/workItems/299"
},
{
"id": 300,
"rev": 1,
"fields": {
"System.Id": 300,
"System.WorkItemType": "Task",
"System.Title": "Unit Testing for MSA login",
"Microsoft.VSTS.Scheduling.RemainingWork": 3
},
"url": "https://dev.azure.com/fabrikam/_apis/wit/workItems/300"
}
]
}
Definitions
Name | Description |
---|---|
Reference |
The class to represent a collection of REST reference links. |
Work |
Describes a work item. |
Work |
Describes a request to get a set of work items |
Work |
Represents the reference to a specific version of a comment on a Work Item. |
Work |
The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}. |
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 |
WorkItemBatchGetRequest
Describes a request to get a set of work items
Name | Type | Description |
---|---|---|
$expand |
The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All } |
|
asOf |
string |
AsOf UTC date time string |
errorPolicy |
The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}. |
|
fields |
string[] |
The requested fields |
ids |
integer[] |
The requested work item ids |
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. |
WorkItemErrorPolicy
The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}.
Name | Type | Description |
---|---|---|
fail |
string |
Fail work error policy. |
omit |
string |
Omit work error policy. |
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