Examples of creating queries

You can find work items by setting constraints on their attributes.
Note: The examples in this topic are for the Eclipse client. The user interface for the query editor in the Eclipse client and the web client is very similar.
While you can arbitrarily mix attribute conditions when you create queries, you might want to follow a general pattern to produce concise definitions. This pattern is based on categorizing work item attributes into five dimensions:

These dimensions are an artificial categorization of attributes for illustrative purposes. They are used as a set of best practices for creating structured queries. The dimensions are not mutually exclusive; they can overlap in different contexts.

The examples that follow are grouped by these dimensions.

Core dimension: The kind of work item

Example attributes: Type, State, Resolution, Severity, Priority

Often, you look for certain work items that can be distinguished by their type, state, severity, or priority. For example, you might want to find all Story or Track Build items, all Unresolved or Verified items, or items of High or Low importance. Setting these types of conditions is a good starting point for creating more complex queries that filter the results with additional conditions.

The core dimension reflects the main attributes of a work item. Placing constraints on attributes in this dimension helps retrieve the information that you are looking for.

Example 1: Find all fixed but unverified work items

Screen capture of setting query attribute conditions to find all fixed but unverified work items

Example 2: Find all unresolved defects

Screen capture of setting query attribute conditions to find all unresolved defects

Example 3: Find all high priority or high severity work items that are still unresolved

Screen capture of setting query attribute conditions to find all high priority or high severity work items that are still unresolved

Content dimension: What the work item is about

Example attributes: ID, Summary, Description, Comments, Tags, Duration, Estimate, custom attributes

In some cases, you know something about the content in work items but not much about the items themselves. Content in work items is available mainly in the form of text. Conditions enable you to query textual values, which can range from specific (for example, the work item ID) to unspecific (for example, the full-text condition). A full-text condition searches for work items that contain the text in their Summary, Description, or Comments attributes.
Note: Full-text search uses word-stemming techniques; therefore, it might return fewer results compared to using the Summary, Description, or Comments attributes directly.

Using other content attributes, such as Tags, Duration, Estimate, and custom attributes, can provide selective results when you know these values in existing work items.

Example 4 (builds on Example 2): Find all unresolved defects that contain the text test failure

Screen capture of setting query attribute conditions to find all unresolved defects that contain the text test failure

Example 5: Find all work items that have a custom attribute that is named Build Notes with a Due Date of 10 days from now

Screen capture of setting query attribute conditions to find all work items that have a custom attribute that is named Build Notes with a Due Date of 10 days from now

People dimension: Who is involved

Example attributes: Filed Against, Team Area, Owner, Creator, Resolver, Modifier, Approvers, Subscribers, Commenters

When you know people or teams that might be involved in work items, you can set constraints on attributes in the people dimension. The people dimension defines the relationship of work items to Rational® Team Concert® users and teams. You can use the people dimension to set constraints on any attribute of the Contributor, Team Area, or Category type. With the people dimension, you can specify who is involved in the work items that you are looking for. For example, users can create, modify, own, or resolve work items. You can find teams by setting constraints on the Team Area and Filed Against attributes.

Example 6 (builds on Example 1): Find all fixed but unverified work items in the Work Item Team Area

Screen capture of setting query attribute conditions to find all fixed but unverified work items in the Work Item Team Area

Example 7 (builds on Example 3): Find all high-priority or high-severity work items that were created by people outside your organization and that are unresolved

Screen capture of setting query attribute conditions to find all high priority or high severity work items that were created by people outside your organization and are unresolved

Temporal dimension: When events happened to the work item

Example attributes: Planned For, Approvals, Creation Date, Resolution Date, Due Date, Modification Date

If you know about events that happened to your work items, you can use attributes from the temporal dimension to find these items. Most conditions in this dimension specify events that occurred within a certain time range or at a certain point in time. However, planning-related and verification-related attributes are included in this dimension as well because planning looks to the future and approvals confirm past activity on work items. Placing constraints on any attribute of the Timestamp, Iteration, or Approval type identifies when an event occurred and, therefore, is considered a search on the temporal dimension.

Example 8 (builds on Example 1): Find all fixed but unverified work items of the Work Item Team Area that were fixed during the current iteration

Screen capture of setting query attribute conditions to find all fixed but unverified work items of the Work Item Team Area that were fixed during the current iteration

Structural dimension: The relationships of the work item

Example attributes: Related, Children, Blocks, Attachments, Resolves, Mentions, Change Sets

The structural dimension refers to structural relationships and links both between work items and with other artifacts. Query conditions in the structural dimension specify how work items relate to other work items and artifacts within the Rational solution for Collaborative Lifecycle Management (CLM).

Linking employs link types to specify relationships between work items. Example link types include Related, Blocks, and Tested By. Linking can be useful, for example, if you know that certain tasks are children of stories.

Artifact relationships, which are defined by artifacts such as attachments, builds, and change sets, show a relationship with the queried work items. If you know about such relationships, you can selectively query for some work items.

Example 9 (builds on Example 2): Find all unresolved defects in the Work Item Team Area that block other teams

Screen capture of setting query attribute conditions to find all unresolved defects in the Work Item Team Area that block other teams

Example 10: Find all work items that you created that were resolved as duplicates and whose duplicates are still unresolved
Note: This query works for direct duplicates only. Longer duplicate chains are not evaluated.

Screen capture of setting query attribute conditions to find all work items that you created that were resolved as duplicates and whose duplicates are still unresolved

Example 11: Find all defects and enhancements in the Work Item Team Area that depend on another unresolved work item

Screen capture of setting query attribute conditions to find all defects and enhancements in the Work Item Team Area that depend on another unresolved work item

Example 12: Find all work items that have an attachment of the .png image type

Screen capture of setting query attribute conditions to find all work items that have an attachment of the .png image type

Example 13: Find all fixed work items that are not included in a build

Screen capture of setting query attribute conditions to find all fixed work items that are not included in a build

Example 14: Find all stories without children

Screen capture of setting query attribute conditions to find all stories without children


video icon Video

Jazz.net channel
Software Education channel

learn icon Courses

IoT Academy
Skills Gateway

ask icon Community

Jazz.net
Jazz.net forums
Jazz.net library

support icon Support

IBM Support Community
Deployment wiki