WIQL Editor Extension for Azure DevOps
Check out one of our favorite add-ins for Azure DevOps — the Work Item Query Language Editor.
Join the DZone community and get the full member experience.Join For Free
one of the nice features of azure devops is extendibility. thanks to the rest api, you can write add-ins or standalone programs that interact with the services. one of the add-ins that i like the most is the work item query language editor , a nice add-in that allows you to interact directly with the underlying syntax of work item query.
once installed, whenever you are in the query editor, you have the ability to directly edit the query with wiql syntax, thanks to the “edit query wiql” menu entry.
figure 1: wiql query editor new menu entry in action
as you can see in figure 2, there are lots of nice features in this add-in, not only the ability to edit a query directly in wiql syntax.
figure 2: wiql editor in action
you can clearly edit and save the query (3) but you can also export the query into a file that will be downloaded into your pc, and you can then re-import in a different team project. this is a nice function if you want to store some typical queries somewhere (source control) then reimport in a different team project, or for a different organization.
if you start editing the query, you will be amazed by the intellisense support (figure 3) that guides you in writing the correct query, and it is really useful because it contains a nice list of all available fields.
figure 3: intellisense in action during query editor.
the intellisense seems to actually be using an api to grab a list of all the valid fields because it even suggests custom fields that you used in your customization process. the only drawback is that it lists all the available fields, not only those available in the current team project, but this is a really minor issue.
having intellisense, syntax checking and field suggestion, this add-in is a really must to install in your azure devops instance.
figure 4: intellisense is available not only on the default field but also on custom fields used in the custom process.
if you are interested in the editor used, you can find that this add-in uses the monaco editor, another nice piece of open-source software by microsoft.
another super cool feature of this extension is the query playground, where you can simply type your query, execute it, and visualize result directly in the browser.
figure 5: wiql playground in action, look at the asof operator used to issue a query in the past.
as you can see from figure 5, you can easily test your query, but what is most important, the asof operator is fully supported and this guarantees you the ability to do historical queries directly from the web interface, instead of resorting using the api. if you need to experiment with wiql and you need to quickly create and test a wiql query, this is the tool to use.
i think that this add-in is really useful, not only if you are interacting with the service with rest api and raw wiql, but also because it allows you to export/import queries between projects/organization and allows you to execute simply historical queries directly from the ui.
having the full support of wiql allows you to use features that are not usually available through the ui, like the asof operator.
as a last trick, if you create a query in the web ui, then edit with this add-in, add asof operator, and then save. this will be saved in the query, so you have a historical query executable from the ui. the only drawback is that, if you modify the query with the web editor and then save, the asof operator will be removed.
Published at DZone with permission of Ricci Gian Maria, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.