(Disclaimer: T-SQL and SSRS expert, about two hours exposure to WIQL)
I have some users that created a Team Foundation Services (TFS) Work Items query using the UI designer that they're in love with, with hard-coded monthly parameters, and have asked me to explore converting this into an SSRS report where they can pass all the parameters they want.
To do that I'm guessing that I'd need to convert the query into T-SQL.
Exporting the report into a .wiq file, then reading the query in the xml within the .wiq file I was able to extract the below WIQL (slightly edited for confidentiality). Problem is, looking at my TFS server, which contains databases TFS_Coniguration, Tfs_CX, Tfs_DefaultCollection, TFS_IT, and TFS_Warehouse, I don't see a table or view named WorkItems anywhere, so I'm at a loss to translate the below WIQL into T-SQL.
If there's some kind of table alias stored in TFS that would give me clues, I'm not seeing it.
So, question: How can I convert the below WIQL into T-SQL?
SELECT
[System.Id], [System.AreaPath], [System.Title], [System.Tags], [System.AssignedTo],
[System.State], [foo.VSTS.Agile.Release], [System.CreatedDate], [Microsoft.VSTS.Scheduling.StoryPoints]
FROM
WorkItems
WHERE
[System.TeamProject] = @project AND
[System.WorkItemType] IN ('User Story') AND
[System.State] = 'Active' AND
[foo.VSTS.Agile.Release] <= '2018-06-10T00:00:00.0000000' AND
[foo.VSTS.Agile.Release] >= '2018-06-30T00:00:00.0000000' AND
[System.AreaPath] UNDER 'AppDev'
ORDER BY
[foo.VSTS.Agile.Release]