Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve the WIQL of a saved query created in TFS

Tags:

tfs

wiql

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?

like image 775
John Henckel Avatar asked Nov 01 '25 02:11

John Henckel


2 Answers

You can use Chrome's "Developer Tools" (under "More Tools") click the Network tab and run the TFS query. You'll see the query item in the list of items. Click on the query item and you'll see the WIQL code in the view pane.

Example: enter image description here

like image 80
Funkpotamus Avatar answered Nov 03 '25 01:11

Funkpotamus


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:

save as dialog

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>
like image 25
DaveShaw Avatar answered Nov 03 '25 00:11

DaveShaw



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!