How to search for your @mentions with JQL

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.

What are @mentions?

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.

Find Jira issues that mention you

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.

my-mention-example.png

my-dashboard-filter-example.png

 

Find Jira issues that mention someone else

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.

teammate-aaid-example.png

teammate-mention-example.png

Summary

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!

11 comments

Yatish Madhav
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 31, 2024

Thanks for this @Jacqui Shadforth  - this is a neat little trick! Haven't thought to use this before ... 

Like # people like this
Susan Waldrip
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 31, 2024

Thank you @Jacqui Shadforth , what a helpful tip and very clearly written. I appreciate this!!

Like # people like this
Amanda Barber
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 31, 2024

This is awesome info! I didn't even know I needed this, but thinking of how I could use it now. 🎉 Thank you, @Jacqui Shadforth

Like # people like this
Marcel Rossouw
Contributor
August 1, 2024

Hi Jacqui, thanks for this however it is not practical to have to find multiple users ID's to find them in JQL searches - the original request in a support ticket you've now closed saying resolved was for all @mentions and currentUser() to be found in a JQL search. It is easy to find one or two particular account ID's but when accessing thousands of tickets with 1000's of employees this is not doable, nor practical - it needs to be dynamic (catchall). This is really Disappointing.

Update: @Jacqui Shadforth was able to assist me with being able to target @mentioned users via automation rule instead targetting the accountId and not having to rely on fetching this information using JQL - thanks a lot Jacqui!

Like # people like this
Jacqui Shadforth
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 1, 2024

Hey @Marcel Rossouw

I'm sorry to hear that. I've messaged you on LinkedIn to understand your use case better and how we may be able to help.

Thanks

Update: After understanding your use case better, which is to extract mentions from Jira issues, I've suggested a solution to you using Jira Automation instead. In this case, I don't believe JQL is the right approach here, as JQL is to retrieve issues rather than users.

Like # people like this
Christopher Ignacio
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 11, 2024

This is not working

Sari Kachorovsky
Contributor
September 12, 2024

@Jacqui Shadforth Thanks for this article. Is there a way to query not on the last -7d update (which will return also items that I was mention on long time ago but the ticket was updated in the 7 d), BUT to get only the tickets that I was mentioned in the last 7 d ? Thanks

Hannah O'Reilly September 16, 2024

@Jacqui Shadforth Is there a way to get the comments in the dashboard to show as an activity stream rather than a list of issues that I have to click into to see the actual comments?

Valeriia_Havrylenko_SaaSJet
Atlassian Partner
September 26, 2024

If you're seeking an easier alternative to JQL and want to view mentions on dashboards, give Mentions Dashboard for Jira a try.

This add-on is designed to help you keep track of mentions you haven't responded to yet, or those where you've mentioned your coworkers and want to see if they've replied.

Add-on developed on Forge ensures secure data storage

Add-on developed by my team.

I hope you find this helpful 🚀

Sari Kachorovsky
Contributor
September 28, 2024

@Valeriia_Havrylenko_SaaSJet Hi, Is there a way to filter it based on the date of the comments? otherwise I will get a very long list that I was mentioned or mentioning someone.

Valeriia_Havrylenko_SaaSJet
Atlassian Partner
September 29, 2024

@Sari Kachorovsky 
Great point, thank you!
The add-on now only displays unanswered mentions, so your gadget will show you only necessary comments.
But the filtering feature is already in our roadmap :)

Like Vitalii_Bobak_SaaSJet likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events