Search code examples
c#wiql

how to compare ID in Work item query language


I am writing a WIQL query where I need to filter out contents based on the ID of a workitem. Here I need to compare the ID with a user defined value and I don't know how to do that.

Below is my code:

string queryString = "Select [State], [Title] From WorkItems Where [Work Item Type] = @Type AND [ID]= ";

I have heard about IDictionary implementation but, I don't know how that will help me here.


Solution

  • Isn't it as simple as adding the value of the ID to the end of the string?

    string queryString = "Select [State], [Title] From WorkItems Where [Work Item Type] = @Type AND [ID]= " + myId;