0
votes

WIQL SEARCH:

{ "query": "SELECT [System.Id] FROM WorkItems WHERE [System.Title] Contains Words 'midserver' AND [System.AreaPath] = 'XXXXX' AND [System.WorkItemType]='Issue' AND [System.State]<>'Done' ORDER BY [System.Id]" },

can you pls help me with a query which refines the search i.e. the query should search the exact words and not CONTAINS ([System.Title] CONTAINS 'Search Text') –
something like IS ([System.Title], i have tried that but it doesn't recognize the query i think "IS" is not recognized

for e.g. story contains following names "rahul 1", and "rahul 2"..but if Iam searching with only "rahul" it should not display "rahul1" and "rahul2" instead it should say something like not found

Observation: its not working if there is space in the user story when i use Contains Words

so basically searching for the exact text if it is there or not but not search with contains

2

2 Answers

0
votes

Since you want to search the exact words, why not just use a " = ". Change your WIQL like this:

SELECT 
  [System.Id] 
FROM WorkItems 
WHERE 
  [System.Title] = 'midserver' 
  AND [System.WorkItemType]='Issue' 
  AND [System.State]<>'Done' 
  ORDER BY [System.Id]
0
votes

Actually the detail supported operators you are using such as =, Contains, Under is based on Field type.

Not all operators could used for each field type. For details, you could take a look at this screenshot:

enter image description here

If you are using System.Title which is a string field

Title

A short description that summarizes what the work item is and helps team members distinguish it from other work items in a list. Reference name=System.Title, Data type=String

So instead of Contains Words, you could directly use "=" in your case. For other kind of fields, you need to follow above operators.