This is not an on-premise install, just VSTS. I'm new to working with the VSTS REST API and WIQL. I am trying to run a query that filters my work items on System.Tags = 'User Generated'
. When I retrieve my Work Item, I can see in the JSON:
System.Tags : "User Generated"
I am using the following guide to build my query and have everything working except when I try to filter on Tags. I have tried [System.Tags] Contains ('User Generated')
, etc. Nothing seems to work. Any ideas?
VSTS WIQL Reference
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. Brilliant!
A WIQL query consists of a SELECT statement (similar to that of the SQL language) that lists the fields to be returned as columns in the result set. (Learn more.) In TestArchitect, you might use a WIQL query to specify the location(s), in terms of test points, to which TA results are to be uploaded to TFS.
You can get the query ID in the URL: Select a query. The URL format will be like: https://[xxx].visualstudio.com/[project]/_queries?id=effb4d62-1b9b-42e9-af7c-dbef725fca4a&_a=query . The id is the value of id parameter.
Ok so right after I give up and post, I figured it out. I was using Contains incorrectly. I had the filter in parenthesis. Both of the following examples work now.
Select [System.Id], [System.Title], [System.State], [System.Tags]
From WorkItems
Where [State] <> 'Closed'
AND [State] <> 'Removed'
AND [Tags] Contains 'User Generated'
AND [System.WorkItemType] = 'User Story'
order by [Microsoft.VSTS.Common.Priority] asc, [System.CreatedDate] desc
Or this:
Select [System.Id], [System.Title], [System.State]
From WorkItems
Where [State] <> 'Closed'
AND [State] <> 'Removed'
AND [System.Tags] Contains 'User Generated'
AND [System.WorkItemType] = 'User Story'
order by [Microsoft.VSTS.Common.Priority] asc, [System.CreatedDate] desc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With