To create complex filters that use OR conditions, negation, and other features not provided by simple filters, use a query language. To write a complex filter, enter a question mark in the filter line, after which the system will prompt you to select an attribute for filtering, a logical operation, or specify a value for the filter.
The query consists of the logical operators AND, OR, NOT, equality and inequality operators, and a selection operator from the IN set. To search for the type "contains", use the tilde character. You can use boosting the priority of a logical operation using parentheses. You must leave a space between operands and values.
The left operand is the path to the attribute. In a simple case, this is the system name of the attribute, for example, Caption. The system prompts you which attributes you can select. The full set of attributes is also available in the Developer's Reference module.
Id is an attribute containing the object's identifier. For example, the expression ?Id = 123 is used to filter data by a specific object ID.
Some attributes are references to other objects. To access them, use the dot symbol. For example, the expression ?Project.CodeName = "test" will select data for a specific project.
If you need to use the name of an object in the filter, then the Caption attribute can be omitted. For example, the expression ?Tags = “one” AND NOT Tags = “two” will select data that contains a tag called “one” and no tag called “two”.
The right operand is a scalar value (a number or text specified in quotes).
When using the IN operator, the values are listed separated by commas, for example IN "one, two, three"
The right operand can also be an object attribute. For example, the expression ?Planned< Fact allows you to select tasks for which actual labor costs exceeded planned ones.
There are several built-in keywords that can be used as the right operand:
When specifying a date, you can use relative expressions, for example, now - today, “-1 days” – “yesterday”.
You can specify the sorting of results in search queries. To do this, add the ORDER BY clause at the end and specify the system name of the attribute. The sorting direction is specified by the phrases ASC - for forward sorting and DESC - for reverse sorting. To sort by multiple fields use a comma, for example ORDER BY Caption ASC, Email DESC
Example requests:
?Caption ~ “text”
?FinishDate > now
?Owner = user OR Watchers.SystemUser = user
?PageType.ShortCaption IN “VI,ST”
?TestScenario.Id != ""
?PageType.IsTesting = "Y" AND NOT TestScenario.Id != ""
?LatestTestCaseExecution.Result.ReferenceName = "failed"