0

I'm using TFS and I would like to get all work items from a specific board. This is how I'm getting the board atm: https://myTFSLink.com/tfs/TPC/ProjectName/MY-BOARD-NAME/_apis/work/boards?api-version=5.1

But nothing about stories/workItems are present in this API request. I know I can get all workItemsRevisions using

GET https://dev.azure.com/{organization}/{project}/_apis/wit/reporting/workitemrevisions?api-version=5.0

but I don't know how I can target this to a specific board :(

I also know that I can get multiple workItems by ID with

GET https://dev.azure.com/fabrikam/_apis/wit/workitems?ids=297,299,300&$expand=all&api-version=5.1

but the ideal would be get all workItems from a specific board as I said in the beginning. Is there any way to do it?

ncesar
  • 1,592
  • 2
  • 15
  • 34

1 Answers1

1

A specific board is corresponding to a Team/Area Path, so you can try to query the work items By Wiql. For example,

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

Request Body:

{
  "query": "Select [System.Id], [System.Title], [System.State] From WorkItems Where [System.WorkItemType] = 'PRODUCT BACKLOG ITEM' AND [Area Path] = 'TestCase\\Team1' order by [System.CreatedDate] desc"
}
Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39