问题
I have created a query in TFS interactively using the web interface. Now I want to get the WIQL that it is using.
The only way I know how is to call the RESTful api, and pass $expand=wiql. Is there an easier way? Ideally from the interactive web interface?
回答1:
Doesn't seem like you can do it in the Web Access. You can however do it in Visual Studio (if you have it).
Open the Query and then Edit it, now if you do File, Save as... you can then save the query as a .wiq
XML file, that will include the WIQL:
Example content:
<?xml version="1.0" encoding="utf-8"?>
<WorkItemQuery Version="1">
<TeamFoundationServer>https://----.visualstudio.com/defaultcollection</TeamFoundationServer>
<TeamProject>Test Agile</TeamProject>
<Wiql>SELECT [System.WorkItemType], [System.Title], [System.State],
[Microsoft.VSTS.Scheduling.StoryPoints], [System.IterationPath], [System.Tags]
FROM WorkItemLinks
WHERE Source.[System.WorkItemType] in group 'Microsoft.RequirementCategory'
</WorkItemQuery>
来源:https://stackoverflow.com/questions/38335488/retrieve-the-wiql-of-a-saved-query-created-in-tfs