Can users that have been mentioned in issues be queried by JQL?

Jacques
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.
August 28, 2012

Since the latest 5.1.3 JIRA upgrade the @mention utility has been improved considerably.

I would like to know if there exists any JQL instruction to query in which issues I (or any other user) was specifically "mentioned"?

14 answers

31 votes
Christian Reichert September 4, 2012

Hi Jaques,

it does work with JQL - here for example is a JQL which I use to provide Users with a list of Issues where they have been mentioned during the last 7 days:

(summary ~ currentUser() OR description ~ currentUser() OR comment ~ currentUser()) and updatedDate >= -7d

Jacques
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.
September 5, 2012

Thanks Christian!

This does indeed do the job!!

Sven Wenzel April 29, 2016
  • (summary ~ "username" OR description ~ "username"  OR comment ~ "username") and updatedDate >= -7d
Like Devyn Shapiro likes this
Joel Edwards May 17, 2017

Very helpful, thanks!

Johan Persson October 10, 2017

The statement from OP can never work since neither currentUser() nor currentLogin() support the text search operator "~".

The text search can only be made with literals. Cannot really understand the technical reason behind this limitation though.

See currentUser()

Like Ian Butler likes this
John Gooch January 10, 2018

strange, I just ran it and it worked as expected. Perhaps it behaves differently based on your Jira installation. 

Like NancyB455 likes this
Sid May 31, 2018

This looks for the user name in the whole comment section. I definitely would NOT want the issues that I commented, I only want the issues that I am mentioned on. So this would not be an ideal solution. @Johan Persson is right. 

Like Ian Butler likes this
NancyB455 May 2, 2019

I did not find that to be true.  This query comment ~ currentUser() ORDER BY created DESC only found where I had been mentioned with an @ sign, not when I had created a comment. (JIRA Server, 7.13.1)

Like Rich Wolverton likes this
Mudi Dissanayake June 6, 2019

doesn't work for me. comment ~ currentUser() doesn't find the issue I'm mentioned on. 

but comment ~ "hello" finds it.

Amy Basque June 7, 2019

Mentions created in the new issue view will not be found in queries. Please vote for this issue! 

https://jira.atlassian.com/browse/JRACLOUD-72207

Like # people like this
Mudi Dissanayake June 10, 2019

Thanks, silly question. how do I vote for that, where the vote link ?

Amy Basque June 11, 2019

Not silly at all! On the right hand side under the reporter, click This affects my team. I took a screenshot for you, but attaching it isn't working. 

Like Игорь Рыжков likes this
5 votes
Jowin Zachariah February 11, 2020

So, I struggled with this myself quite a bit and none of the above answers worked out for me. The only workaround I found is hardcoding the id of the user (sigh!, why Jira?) and then using jql like this : 

comment ~ 551000:10eea9db-900e-4000-9bf0-f9000ceee7d5 AND updatedDate >= -7d AND status not in ("Done")

In chrome : 

To get this id, right-click on a comment where the user is tagged and click inspect element.

You will see a <p> tag and if you expand that you should have one of the <span> tags with data-mention-id of the user you want to search for.

Jasmyn Han February 13, 2020

This worked great for me

Like marijana_bello likes this
Marek Jasiulewicz April 28, 2020

great tip thanks 

Jolie Huang May 31, 2020

data-mention-id works! Thank you so much!

Both currentUser() and username didn't work for me. 

Nazar Konevych April 20, 2021

this is exactly what I was searching for. Works as a charm

Simon WYCKAERT November 4, 2021

Very helpful, worked for me. Thank you!

4 votes
Joana Correia July 16, 2019

HI all, anyone knows how I could query the tickets where i was mentioned on the last comment of the ticket?

 

thanks!!

Sheila Ottersen January 11, 2020

I also need this feature

Like Kira Williams likes this
2 votes
Katie Thebeau March 1, 2016

How do I change current user to another user in the system for this: 

  • (summary ~ currentUser() OR description ~ currentUser() OR comment ~ currentUser()) and updatedDate >= -7d

Not sure why I am having such a hard time! smile

Robert Wójcik May 8, 2017

Username = katiethebeau

(summary ~ katiethebeau OR description ~ katiethebeau OR comment ~ katiethebeau) and updatedDate >= -7d

1 vote
hudziakp July 20, 2020

You can use this plugin: https://marketplace.atlassian.com/apps/1222753/user-mentioned-jql 
but it will show only those ticket where comments/descriptions were created after installation.

1 vote
Trilok Singh Vinjrawat May 13, 2019

I am looking for a JQL that can show the issues where the current user was mentioned in comments that were made in the last 7 days. 

NancyB455 June 4, 2019

Hmm, interesting.  Setting aside the user mention for a moment, is it possible to query for issues that have been commented on in the last 7 days (and not updated in any other way?)  

Like Sheila Ottersen likes this
1 vote
Jacques
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.
August 30, 2012

hi Mirek,

thanks for mentioning this, but I knew this already :)

I just thought that if they add this cool feature that there should be a way to filter for issues where you've been mentioned as they might be issues where you're none of the regular roles (assignee, reporter, watcher,...) that already exist and for which you can filter.

I found this issue talking about this feature: https://jira.atlassian.com/browse/JRA-27594 and as mentioned there (I've also tried in my environment) filtering for @mentions doesn't work.

Let's wait if some more people vote on the forementioned issue to get it implemented.

regards,

Jacques.

0 votes
Nancy Bonanno February 13, 2020

If you have access to issuefunction, then issuefunction in commented("by userID after/before yyyy/mm/dd") works well.

0 votes
Ana Bolanos August 16, 2019

This one works for us.

(details ~ currentuser() OR comment ~ currentUser()) AND updated >= -7d AND status not in (closed)

HOWEVER, it is for the current user. I want to see a specific person that was mentioned as he will be OOO. I think in a comment above someone alluded to that this cannot be done.

Ana Bolanos August 16, 2019

I found it!

This use case is to cover for someone that is OOO, so the fact that it captures the comments it creates is not an issue. 

(comment ~ mmouse OR details ~ mmouse) AND updated >= -1d AND status != Closed

and as someone mentioned, go to this ticket and vote for it. 

https://jira.atlassian.com/browse/JRASERVER-27594

Like Andy Heinzer likes this
0 votes
Trilok Singh Vinjrawat May 13, 2019

One thing I have noticed with this JQL is that, if the current user was mentioned in a Jira Issue months ago and the issue was updated without the currentuser mentioned in the past 7 days the JQL still returns that Jira Issue.

0 votes
Anthony Brittis May 7, 2019

I know this is an old question, but I just ran this JQL and noticed that it only returns issues where currentUser() is mentioned in the LAST comment.  It didn't locate issues where currentUser() was mentioned in other comments besides the last one.  

Has anyone else seen this behavior?

Anthony

Amy Basque June 3, 2019

I haven't seen that, but this filter is not working quite right for me. It is not showing all tickets that a user is mentioned in. I can't figure out what's different about the tickets that are showing up compared to the ones that are missing (they're in the same project, same workflow status, same issue type, etc.). 

Like Anthony Brittis likes this
0 votes
Ernesto Ruy Sanchez June 5, 2014

I'm using JIRA OnDemand (6.2 as of right now I think?).. and this does not work as I expected

I expect to get a list of issues where I have been mentioned using @ + myname

However, I do get a list of issues where my name has been mentioned as text in a comment, but not as an actual @mention

Anyone having this same problem?' What is the JQL query for this?'

I tried the JQL: comment ~ currentUser()

Andreas Vallberg May 26, 2018

In Jira On Demand, this worked for me. I guess it is case sensitive.

project = ABCD AND comment ~ CurrentUser()  ORDER BY created 

0 votes
Stuart Dalrymple May 21, 2014

Hi all,

I am using the following JQL to create a filter on @mentions:

comment ~ currentUser() and updatedDate >= -30d

It works, however, when I've gone and deleted the comments I was mentioned in (they were for testing the filter) - they still show up in the search! Is the JQL searching the history and not the comments that actually exist? Is there another JQL that will only display the items I'm still actively mentioned in?

0 votes
Mirek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2012

Hi Jacques,

As I know mentioning is only used to share the issue with other users (the same behavior like using Share button) and send a notification. It is not possible to achieve a search who was mentioned in a particular issue.

You can only search for issues that a particular user is watching or voting using:

* watcher

* voter

like for example..

watcher = someone, watcher = currentUser()

If you want that kind of feature you can create a new request. For more information about how Atlassian implement New Features, please see the Implementation of New Features Policy.

I hope that will help

Regards,

Mirek

Suggest an answer

Log in or Sign up to answer