Q:

How to Get the iteration path or iteration ID in TFS rest API?

I'm trying to get the tasks of a specific iteration. I know I can get that with the iteration path or the Iteration ID. I have this query:
SELECT * 
  FROM WorkItems
  WHERE [System.WorkItemType] = 'Task'
    AND [System.IterationID] = 24138

The query works fine, but I don't have a way to get that Iteration path or the Iteration ID.
Is there a way to get the iteration ID?

A:

You'll have to query the tables from Tfs_Warehouse database. You can find the reference here. The query looks like below:
SELECT * from DimWorkItem dwi
INNER JOIN DimIteration di on dwi.IterationSK=di.IterationSK
WHERE dwi.System_WorkItemType = 'Task'
AND di.IterationPath = 'foobar'

