1

I'm working on fetching all the Workitems from VSTS using REST APIs. I come across this documentation Get data for each work item returned

It's a POST method and we are not passing any body, will it return all the workitems as mentioned in the documentation?

Thanks, Siva

S.Siva
  • 1,901
  • 4
  • 17
  • 22

2 Answers2

2

You could use Reporting Work Item Revisions API:

GET https://{accountName}.visualstudio.com/{project}/_apis/wit/reporting/workitemrevisions?api-version=5.0-preview.2

If you don't want to all revisions, you could add includeLatestOnly parameter:

GET https://{accountName}.visualstudio.com/{project}/_apis/wit/reporting/workitemrevisions?includeLatestOnly=true&api-version=5.0-preview.2
Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
0

According to the docs, the request body is optional, so your assumption is most likely correct. [Of course, it's better to try it once than guess ;-)]

enter image description here

However, the request like that can be inefficient if it runs on a large number of work items. Consider filtering it to narrow down the response data.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
  • Yeah I tried it, we are getting a 400 Bad Request, if we don't pass any body. The WIQL query returns me only the Work Item ID and URL of the Work Item. I'm trying to find out an API to fetch all the workitems(expanded) without passing any IDs. – S.Siva May 18 '18 at 12:38