Search Query Grammar
This page provides a BNF description of the YouTrack search query grammar.
Grammar
<SearchRequest> ::= <OrExpression>
<OrExpession> ::= <AndExpression> ('or' <AndExpression>)*
<AndExpression> ::= <AndOperand> ('and' <AndOperand>)*
<AndOperand> ::= '('<OrExpression>? ')' | Term
<Term> ::= <TermItem>*
<TermItem> ::= <QuotedText> | <NegativeText> | <PositiveSingleValue> | <NegativeSingleValue> | <Sort> | <Has> | <CategorizedFilter> | <Text>
<CategorizedFilter> ::= <Attribute> ':' <AttributeFilter> (',' <AttributeFilter>)*
<Attribute> ::= <name of issue field>
<AttributeFilter> ::= ('-'? <Value> ) | ('-'? <ValueRange>) | <LinkedIssuesQuery>
<LinkedIssuesQuery> ::= ( <OrExpression> )
<ValueRange> ::= <Value> '..' <Value>
<PositiveSingleValue> ::= '#'<SingleValue>
<NegativeSingleValue> ::= '-'<SingleValue>
<SingleValue> ::= <Value>
<Sort> ::= 'sort by:' <SortField> (',' <SortField>)*
<SortField> ::= <SortAttribute> ('asc' | 'desc')?
<Has> ::= 'has:' <Attribute> (',' <Attribute>)*
<QuotedText> ::= '"' <text without quotes> '"'
<NegativeText> ::= '-' <QuotedText>
<Text> ::= <text without parentheses>
<Value> ::= <ComplexValue> | <SimpleValue>
<SimpleValue> ::= <value without spaces>
<ComplexValue> ::= '{' <value (can have spaces)> '}'
Grammar is case-insensitive.
For a complete list of search attributes, see Search Query Reference.
To see sample queries for common use cases, see Sample Search Queries.
Last modified: 21 April 2023