5

I would like to create a work item query where the user is always asked to pass the value of the argument he wants.

For example:

Team project=  @Project
And Work Item Type = Bug
and State = ?

Then the user is asked for which state he wants to get the results.

Any ideas?

janw
  • 8,758
  • 11
  • 40
  • 62
PatriceVB
  • 1,053
  • 1
  • 10
  • 28
  • This is not possible, nor do we have it on the backlog. I would like to understand why you have this requirement. What I see happening is that the number of states is limited and for each state a new query is created. So if the user wants to see all bugs in the Active state, there is a query called "Active bugs". That is I believe much more user friendly than prompting the user. – Ewald Hofman Mar 29 '12 at 18:23
  • The idea is to be able to quickly get a Work Item according to its ID or according to another identifier. – PatriceVB Apr 27 '12 at 14:17
  • In TFS11 you can use the Search box for that. It is in Web Access and in Visual studio and it searches on ID and in the Title, Description and Steps to Reproduce. – Ewald Hofman May 02 '12 at 15:02
  • 1
    One scenario where this would be useful would be to allow searching on a specific field. In our case, we have a custom field that contains a cross reference number to a work item in our old system. The search box won't work because entering just a number in the search box brings up the work item with that ID number. (or more likely gives an error if it doesn't exist). If we could write a query to prompt for the value, then we could search directly on the custom field without it thinking we wanted an ID instead. – Steve In CO Jul 05 '16 at 21:54
  • In a follow up to my above comment, I discovered today that you CAN search by field from the search box. You can enter ""=. Unfortunately AND/OR doesn't appear to be supported so it won't help the original question. – Steve In CO Jul 06 '16 at 18:09
  • @EwaldHofman, my organization has many teams. Each team has a unique area path. We do a lot of short term projects (1-3 months). Every time we start a new project, the manager creates a new team, new area path, and creates a new set of Shared Queries to show the bugs, initiatives, etc, **for that area path**. This is a silly redundant task. It would be **SO MUCH** better if we could just have a single set of queries using @ AREAPATH, and simply pass the area path as a URL parameter. -- Yes we can use WIQL but how to show the results? write our own web page from scratch? That would be nuts. – John Henckel Sep 02 '16 at 16:20
  • @EwaldHofman - Is it still the case that TFS variable/macros do not support prompting for a value? My company just merged two huge TFS repositories -- I have no idea why anyone thought that would be a good idea -- and now the only way to find items under their old IDs is to search based on the "Reflected Work Item ID". It does no good to type in the old ID in the search bar, that pulls up something entirely unrelated. I want to click on a link, have it prompt me for the old ID, and then it gives me the result. I can edit the query every time but that seems silly. – phonetagger Jun 24 '19 at 15:29

1 Answers1

4

Queries does not support parameters.

What you can do:

Community
  • 1
  • 1
KMoraz
  • 14,004
  • 3
  • 49
  • 82