G’day Atlassian community!
In this post, I share how to use JQL to find Jira issues that mention you or someone else. These queries can be used for searching, creating filters, dashboard gadgets, automations, and organizing Jira issues where you’re mentioned. Read on for more details.
In Jira, you can mention a person in an issue’s description, comment, or any other text-search-supported field. Mentioning someone will notify them, so it’s a great way to bring attention to a particular issue.
Under the hood, the plaintext of a mention is represented in the wiki-style format [~accountid:abc123]
, where abc123
represents the user’s Atlassian account ID (often shortened to AAID). This is the format that is tokenized in the database and hence makes abc123
searchable.
You can search for comments that mention you with the JQL query:
comment ~ currentUser()
To find only those issues updated in the past week, simply add an updated clause:
comment ~ currentUser() AND updated >= -7d
Taking it a step further, a good rule of thumb is to always provide a project
clause in your queries. This limits the search to only projects you care about and improves the overall performance of your search.
project IN (FOO, BAR) AND comment ~ currentUser() AND updated >= -7d
The examples above focus on finding mentions in comments, but it’s possible to search for mentions in any rich-text-based field, such as description
, environment
, and worklogComment
.
The text
JQL field will search across all of the aforementioned fields, including summary
and searchable text-based custom fields. But remember, the more specific your query, the quicker your search will be.
Because currentUser()
is dynamic, it’s possible to create a JQL filter that all teammates can use to find their own mentions. There’s no need to create a JQL filter for each user, which would add maintenance overhead for admins.
JQL autosuggestions will not suggest the currentUser()
function or other users when you write a text search query.
This means that in order to find a teammate’s mention, you will need to find their Atlassian account ID. You can do this by navigating to their user profile in Teams and copying the ID that appears after /jira/people/
in the URL. Use your teammate’s AAID to search for their mentions.
In this post, we covered how to search for mentions in text fields using JQL. You can use these JQL queries to organize issues where you’re mentioned, as well as build automations, dashboard gadgets, or dynamic JQL filters that you can share and use with your team.
If you’d like to know more about JQL text search, see: Search for issues using the text field.
Thanks for reading!
Jacqui Shadforth
Senior Software Engineer
Atlassian
London, United Kingdom
11 comments