Going Stellar

Home/CQL reference

CQL field

mention in CQL (Confluence): syntax and examples

The mention field finds content that contains an @mention of a given user. Use it to build a list of pages and comments that mention you, or to check where a person is referenced before they leave a project. You can match by accountId, by currentUser() or by full name through a sub-field.

Syntax

mention = currentUser()
mention = "<accountId>"
mention in ("<accountId>", "<accountId>")
mention.fullname ~ "name"

Arguments

ArgumentWhat it does
valueAn accountId in quotes, or the function currentUser(). The doc also lists public name and full name as ways to find a user.

Works with

  • Operators: =, !=, IN, NOT IN (~, !~, >, >=, <, <= are rejected)
  • Functions: currentUser()
  • Sub-field: mention.fullname accepts ~ (full name matching depends on profile visibility)
  • Not with: ~ on mention itself, use mention.fullname for name matching

Examples

mention = currentUser() AND type = page

Lists the pages where someone tagged you, as a personal to-do list.

Run on Confluence Cloud on .

mention = currentUser() AND space = SD AND type = comment

Finds comments in one space that mention you, so a reply does not get lost in a long thread.

Run on Confluence Cloud on .

mention.fullname ~ "alana"

Finds content that mentions anyone whose full name contains a word, when you do not have an accountId.

Run on Confluence Cloud on .

mention in ("99:27935d01-XXXX-XXXX-XXXX-a9b8d3b2ae2e", "48293:5s04-XXXX-XXXX-XXXX-d7a9b9d8c9f01")

Finds content that mentions either of two people, for example the two owners of a service.

Run on Confluence Cloud on .

mention = "99:27935d01-XXXX-XXXX-XXXX-a9b8d3b2ae2e"

Finds every place one person is mentioned, using their accountId.

Run on Confluence Cloud on .

Pitfalls

  • mention ~ "alana" fails with: Operator '~' is not supported for field 'mention'. Name matching needs the sub-field mention.fullname.
  • Do not use text search to find mentions. text ~ "alana" looks for the word, while mention is the field for tagged users.
  • mention != currentUser() keeps everything that does not mention you, including all content with no mentions at all. It is a very large set, so add space and type.
  • accountId values from the docs end in XXXX groups. Replace them with a real accountId, otherwise the query runs and finds nothing.

Sources

  1. CQL fields (Atlassian Developer, Confluence Cloud)

Markdown version · All CQL pages