Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

WIQL Editor Extension for Azure DevOps

DZone 's Guide to

WIQL Editor Extension for Azure DevOps

Check out one of our favorite add-ins for Azure DevOps — the Work Item Query Language Editor.

· DevOps Zone ·
Free Resource

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.

Wiql query editor

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.

image

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.

image

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.

image

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.

image

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.

Topics:
devops ,devops and agile ,wiql ,work item query language editor ,azure ,azure devops ,add-in ,tutorial ,intellisense

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}