Suppose you regularly query for the assigned work of each of your team members. You can create a query for each team member, but this results in multiple queries that are slight variations of each other. A better choice would be to parameterize this variation using a prompting query, say "System ABC defects assigned to user." When you initiate the query, you see a list of team members.
Placeholders are used in defining prompting queries. Placeholder keywords are locations in the query that are completed by the user each time a query runs. For example, say that you are a team lead, with Tom, Jane, and Joe on your team. You used to run separate queries to find out about the workload - you queried separately for CRs assigned to each team member. Now you can create one query that prompts you for the name of the resolver, and then shows the assigned CRs for that team member.
To construct this query, use a placeholder keyword instead of a specific name. Placeholder keywords use the form %integer, such as %1, %2, %3, and so on. Placeholder keyword values must always be supplied by you as part of the process of running the query. Placeholder keywords are different from standard keywords, which are automatically provided by the system.
Placeholder keywords and standard keywords, for example, %username, can be mixed in the same query string. Placeholders are recognized by their unique pattern; they are always an integer. For example, %% is interpreted as a literal percent sign if you want to include a percent in the query. Typing keyword='%%1' searches for CRs with keywords of %1. A single % (%1) indicates a placeholder where the user must supply the value before the query is run.
The numbering of the integers used as placeholders determines the order that the placeholders values are requested from you. The order the integers are used in the query is irrelevant. In this example, the query release='%2' and owner='%1' prompts you for the Owner value before the Release value.
Placeholders are reusable in the same query. You are prompted only once for each unique placeholder. The system replaces each occurrence of the same placeholder with the same value.
The most common way to specify placeholders is to select from existing values for your prompting query. Select the attribute name that corresponds to the information that you want to use in the query. For example, select from the team members who have been assigned CRs. You would select Resolver as the attribute to use in the query. The system prompts you with the user names in the database. You can then select the team member on which to query, and run the query. Without redefining the query, you can select another team member on which to query.
Attributes are kept up-to-date as changes are made in the database. For example, if attribute types are modified in the lifecycle editor, the placeholder using that attribute automatically updates to reflect the change.
You can create customized placeholders by selecting the Type (as opposed to Attribute) when defining the placeholder. When selecting the Type, you define if the placeholder input is in the form of a string, date, or list box. This setting determines the placeholder value when the information is collected.
For example, you can create a custom list box. Select Listbox as the type, and then enter a set of values to be shown as list box choices in the prompt. Then set up a manageable set of choices for the placeholder value, instead of entering a free-form string every time you run the prompting query. Placeholder list boxes are not shared, as they are used only for the particular placeholders of the particular prompting queries for which they are created.