Complete reference for TargetProcess filtering and query expressions.
Source: IBM TargetProcess Sorting and Filters
Filter using the where parameter:
./tpcli list Bugs --where "EntityState.Name eq 'Open'"| Operator | Example | Meaning |
|---|---|---|
eq |
Name eq 'Bug' |
Equals |
ne |
Status ne 'Closed' |
Not equals |
| Operator | Example | Meaning |
|---|---|---|
gt |
Id gt 1000 |
Greater than |
gte |
Id gte 1000 |
Greater than or equal |
lt |
Priority.Id lt 5 |
Less than |
lte |
Priority.Id lte 5 |
Less than or equal |
| Operator | Example | Meaning |
|---|---|---|
contains |
Name contains 'auth' |
Contains substring |
not contains |
Tags not contains 'urgent' |
Does not contain |
| Operator | Example | Meaning |
|---|---|---|
in |
Id in (1,2,3) |
In list |
| Operator | Example | Meaning |
|---|---|---|
is null |
Description is null |
Is empty |
is not null |
Description is not null |
Is not empty |
Combine multiple conditions:
./tpcli list Bugs \
--where "EntityState.Name eq 'Open' and Priority.Name eq 'High'"Both conditions must be true.
❌ NOT SUPPORTED in API v1
Workaround: Use separate queries and merge results
Optional grouping:
# Both equivalent:
./tpcli list Bugs --where "Project.Id eq 123 and EntityState.Name eq 'Open'"
./tpcli list Bugs --where "(Project.Id eq 123) and (EntityState.Name eq 'Open')"Access related entity fields with dot notation:
Owner.FirstName # Owner's first name
Project.Name # Project name
EntityState.Name # Status name
Priority.Id # Priority ID
Feature.Epic.Name # Epic of parent featureFilter by date (ISO 8601 format):
# Created after date
./tpcli list UserStories --where "CreateDate gt '2024-01-01'"
# Modified in date range
./tpcli list Tasks \
--where "ModifyDate gte '2024-11-01' and ModifyDate lt '2024-12-01'"./tpcli list Bugs --where "CustomFields.RiskLevel eq 'High'"Wrap in quotes:
./tpcli list UserStories --where "'CustomFields.Field Name' eq 'Value'"- Text:
eq,ne,contains - Number:
gt,lt,gte,lte,eq - Date:
gt,lt,gte,lte - Dropdown:
eq,ne
Cannot filter by Calculated Custom Fields
Filter items with tags:
# Has tag 'urgent'
./tpcli list UserStories --where "Tags contains 'urgent'"
# Tag with spaces (in double quotes inside)
./tpcli list UserStories --where "Tags contains '\"two word tag\"'"
# Multiple words tag with wildcards
./tpcli list UserStories --where "Tags contains '*abc*'"Use * for wildcard matching:
# Starts with 'auth'
./tpcli list Bugs --where "Name contains 'auth*'"
# Ends with 'bug'
./tpcli list Bugs --where "Name contains '*bug'"
# Contains 'bug' anywhere
./tpcli list Bugs --where "Name contains '*bug*'"
# ❌ NOT supported: wildcards in middle
# ./tpcli list Bugs --where "Name contains 'b*g'" # WRONGUse backslash:
./tpcli list UserStories --where "Name contains '\\''"Filter by true/false:
# Active users
./tpcli list Users --where "IsActive eq 'true'"
# Inactive
./tpcli list Users --where "IsActive eq 'false'"./tpcli list Bugs \
--where "Project.Id eq 1234 and EntityState.Name eq 'Open' and Priority.Name eq 'High'"./tpcli list Tasks \
--where "AssignedUser.Id eq 456"./tpcli list UserStories \
--where "Description is null"./tpcli list UserStories \
--where "CreateDate gt '2024-11-22'"./tpcli list UserStories \
--where "Iteration.IsCurrent eq 'true'"Wrap complex filters in single or double quotes:
# Single quotes
./tpcli list Bugs --where 'Name contains "special"'
# Double quotes
./tpcli list Bugs --where "Name contains 'special'"Use proper quoting:
#!/bin/bash
FILTER="EntityState.Name eq 'Open'"
./tpcli list Bugs --where "$FILTER"- ❌ OR operator
- ❌ Filtering by nested collection contents
- ❌ Calculated custom fields
- ❌ Filtering by attachments
For OR logic, make separate API calls:
# Get high priority bugs
./tpcli list Bugs --where "Priority.Name eq 'High'" > high.json
# Get urgent bugs
./tpcli list Bugs --where "Tags contains 'urgent'" > urgent.json
# Merge results
jq -s 'map(.Items[]) | unique_by(.Id)' high.json urgent.jsonSort results with orderBy:
# Ascending (default)
./tpcli list UserStories --where "..." --orderBy=CreateDate
# Descending
./tpcli list UserStories --where "..." --orderByDesc=CreateDate
# Multiple sort (see API v2 reference)Note: tpcli currently supports basic sorting. See API v2 for advanced multi-field sorting.
- Filter early - Use
--whereto reduce result set - Limit results - Use
--taketo avoid huge responses - Select fields - Use
--fieldsto reduce data transfer - Avoid wildcards at start -
*textis slower thantext* - Index-friendly filters - Filter by ID or state is fast