theonedev/onedev · error · ExplicitException
Criteria '${operator}' is not supported here
Error message
Criteria '${operator}' is not supported here What it means
In IssueQuery's ANTLR visitor, the 'MentionedMe' operator criteria is only allowed when the parse option enables current-user criteria (option.withCurrentUserCriteria(), typically set by the IssueQuery annotation). Otherwise an ExplicitException "Criteria 'MentionedMe' is not supported here" is thrown, because the query context has no notion of 'me'.
Source
Thrown at server-core/src/main/java/io/onedev/server/search/entity/issue/IssueQuery.java:204
@Override
public Criteria<Issue> visitNumberCriteria(NumberCriteriaContext ctx) {
return new NumberCriteria(getNumber(ctx.getText()), Is);
}
@Override
public Criteria<Issue> visitFuzzyCriteria(FuzzyCriteriaContext ctx) {
return new FuzzyCriteria(getValue(ctx.getText()));
}
@Override
public Criteria<Issue> visitOperatorCriteria(OperatorCriteriaContext ctx) {
switch (ctx.operator.getType()) {
case Confidential:
return new ConfidentialCriteria();
case MentionedMe:
if (!option.withCurrentUserCriteria())
throw new ExplicitException("Criteria '" + ctx.operator.getText() + "' is not supported here");
return new MentionedMeCriteria();
case SubmittedByMe:
if (!option.withCurrentUserCriteria())
throw new ExplicitException("Criteria '" + ctx.operator.getText() + "' is not supported here");
return new SubmittedByMeCriteria();
case WatchedByMe:
if (!option.withCurrentUserCriteria())
throw new ExplicitException("Criteria '" + ctx.operator.getText() + "' is not supported here");
return new WatchedByMeCriteria();
case IgnoredByMe:
if (!option.withCurrentUserCriteria())
throw new ExplicitException("Criteria '" + ctx.operator.getText() + "' is not supported here");
return new IgnoredByMeCriteria();
case CommentedByMe:
if (!option.withCurrentUserCriteria())
throw new ExplicitException("Criteria '" + ctx.operator.getText() + "' is not supported here");
return new CommentedByMeCriteria();
case FixedInCurrentBuild:View on GitHub (pinned to d44925c47c)
Solutions
- Set withCurrentUserCriteria = true on the @IssueQuery annotation so user-relative criteria are accepted
- Remove 'MentionedMe' from the query or replace it with an explicit user criteria like 'Mentioned "user"'
- If parsing programmatically, pass an option with withCurrentUserCriteria() == true
Example fix
// before @IssueQuery(name="My Query", order=...) // withCurrentUserCriteria defaults false // after @IssueQuery(name="My Query", withCurrentUserCriteria=true, order=...)
Defensive patterns
Strategy: validation
Validate before calling
if (queryText.matches(".*\\bMentionedMe\\b.*") && !option.withCurrentUserCriteria())
throw new ExplicitException("MentionedMe requires withCurrentUserCriteria=true"); Try / catch
try {
IssueQuery.parse(project, queryText, option);
} catch (ExplicitException e) {
// inform user this field does not support *Me criteria
} Prevention
- Always set withCurrentUserCriteria=true on @IssueQuery fields where users type queries
- Reject *Me tokens in query fields that run without a user context
When it happens
Trigger: Parsing an issue query containing 'MentionedMe' with parse options where withCurrentUserCriteria is false — e.g. text of an IssueQuery-annotated field that didn't set withCurrentUserCriteria=true, or programmatic IssueQuery.parse with default options.
Common situations: Declaring an @IssueQuery field without withCurrentUserCriteria=true while users type 'MentionedMe' into it; embedding user-entered queries into contexts that disallow user-relative criteria (e.g. subscription or automation queries).
Related errors
- Please login to perform this query
- Link spec not found: ${linkName}
- Unrecognized command:
- Unable to discover cluster ip from database connection url:
- Time tracking needs to be enabled for the project
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/fb4ec9c57c481523.
Report an issue: GitHub.