2

I get only the workitem ID with following rest api

https://dev.azure.com/{organization}/{project}/{team}/_apis/wit/wiql/{id}?api-version=5.0

response:

enter code here
"workItems": [{
    "id": 4,
    "url": "https://dev.azure.com/Eran/4fb8b0cb-ad4a-444c-8390-14877150ae8c/_apis/wit/workItems/4"
},
{
    "id": 16,
    "url": "https://dev.azure.com/Eran/4fb8b0cb-ad4a-444c-8390-14877150ae8c/_apis/wit/workItems/16"
},
{
    "id": 17,
    "url": "https://dev.azure.com/Eran/4fb8b0cb-ad4a-444c-8390-14877150ae8c/_apis/wit/workItems/17"
}]

How do I get the all other fields of a workitems instead of making an individual REST call to each workitem.

dparkar
  • 1,934
  • 2
  • 22
  • 52

1 Answers1

0

I investigated the REST API and the javascript client API. As of 9/19/2019, you have to make two calls, first to run the query which only returns back the list of IDs and the corresponding URL and then again to get work items details for each of the work items. But you don't have to make a call of each one as there is a get work item details in batch available.

It would have been nice if the first call itself would return the fields as per the projection requested in the query.

dparkar
  • 1,934
  • 2
  • 22
  • 52