Introducing MantisHub Query Language: Fast, Flexible Issue Filtering
Building an issue filter on the Issues page is quick when you are working on your own, but sharing that exact view with a teammate or reusing it in a script used to mean walking through filter controls one by one. MQL (MantisHub Query Language) gives every issue filter a compact, readable text form that you can copy as a link or pass directly to the REST API.
Find MQL and share a filter link
You do not need to memorize MQL syntax to get started. On the Issues page, open the filter editor, choose your criteria, and click Apply.


Next, click the eye icon beside View Issues to display the MQL for your current filter. This line is read-only and updates automatically whenever you change and apply criteria in the editor.

To share that view, click the link icon at the start of the MQL line to copy a View Issues URL. Anyone who opens the link sees the same filtered list, subject to their own project access and permissions.

The shape of a query
An MQL query combines one or more filter conditions with AND:
<field> <operator> <value> [AND more conditions]
Here is a query for unresolved issues assigned to you:
assignee = user() AND status < statusResolved()
assignee = user()matches issues assigned to the account running the query.status < statusResolved()matches every status below your instance's configured resolved-status threshold, so the query keeps working even if an administrator customizes your workflow statuses.- On an instance with the default status setup, the MQL line for built-in
filters such as Assigned to me shows the status name directly:
status < resolved.
Lists and enumeration values
To match any of several values on one field, use IN (...):
priority IN (high, urgent)
status IN (new, assigned)
For fields with a fixed list of values like status, priority, severity,
resolution, projection, and view_state, you can also exclude values with
NOT IN (...):
status NOT IN (resolved, closed)
These enumeration fields match your instance's case-sensitive internal enum
names (such as new, assigned, high, or urgent) or their numeric IDs,
rather than localized UI labels—so a query works the same regardless of each
teammate's language setting. Quote any value that contains a space, such as
resolution = "unable to duplicate".
Absolute and relative dates
When you pick dates in the filter editor's calendar, MQL shows fixed dates and any copied filter link keeps them. When you write MQL yourself, dates match calendar days (time of day is ignored) and can take three forms:
- a fixed date, such as
2026-01-01 - a relative offset, such as
-7dfor seven days ago or-2wfor two weeks ago - a date function, such as
today()orstartOfMonth()
To filter a date range, combine two conditions on the same date field with
AND:
created_at >= 2026-01-01 AND created_at <= 2026-03-31
Common query examples
Unassigned issues that are high or urgent:
assignee = none() AND priority IN (high, urgent)
Text search over the last two weeks:
search("login error") AND updated_at >= -14d
Issues opened this month, including closed ones (without a status condition,
closed issues are hidden by default):
created_at >= startOfMonth() AND status = any()
Duplicates of issue 123, including closed ones:
duplicateOf(123) AND status = any()
A custom field together with a 30-day due-date window:
cf["Tier"] = Gold AND cf["Due"] >= today() AND cf["Due"] <= 30d
Defaults to keep in mind
Any condition you leave out falls back to the same defaults as the Issues page:
- Status. Closed issues are hidden unless your query includes a
statuscondition. Addstatus = any()to include them. - Project. Queries run against the current project unless the query names
one, such as
project = Websiteorproject = "Mission Impossible". - Sort. Results default to last updated, newest first.
- Page size. Results default to 50 issues per page, matching your instance's default view limit.
Use MQL in links and the REST API
Filter links. Copy a filter link from the Issues page to send a live view to a teammate, embed it in a wiki page, or drop it into a dashboard note.
REST API. The ApiX issue list endpoint accepts MQL directly when you set
the filter type to mql. In API queries, you can also append an ORDER BY
clause to sort results alongside page and page_size for pagination:
curl -X POST \
-H "Authorization: Bearer replace-with-user-API-token" \
-H "Content-Type: application/json" \
"https://yourmantishubname.mantishub.io/api/rest/plugins/ApiX/issues_list" \
-d '{
"project": { "id": 1 },
"filter": {
"type": "mql",
"query": "assignee = user() AND status < statusResolved() ORDER BY priority DESC"
},
"page": 1,
"page_size": 25
}'
Learn more
- MQL reference: full list of fields, operators, date functions, and common errors.
- Using Filters: how to build, apply, and share filters on the Issues page.
- REST API reference: full documentation for MantisHub and ApiX endpoints.