Find all mentions in comments via JQL

David July 8, 2019

Hello,

 

I have seen several other posts about this, however I can not get the intended outcome.

 

I want to find all mentions of a user (in this example, myself). I use the query

comment ~  currentUser()  

 And I do indeed find mentions of myself. However Only in old projects, not in any new projects (projects started ~1month ago). If add a filter for a specific (new) project, the query returns nothing

 

Is this just a bug with Jira? Am I doing something wrong?

 

Thanks in advance!

8 answers

1 accepted

13 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 11, 2019

Hi David,

I understand that you are using Jira Cloud and want to find all the @ mentions in comments of a particular user.   It appears that you can find some of these with the currentUser() function, but not all examples appear here.

I am actually surprised to see that you could use that specific JQL function in the comment search field at all.  When reviewing the documentation of that function in Advanced searching - functions reference - currentUser(), you can see that the only supported operators for this are = and !=.   However since text fields like comment only have supported use of ~ or !~ the text fields like these are not unsupported to use that kind of function.   I am surprised to see currentuser() work at all in this context to be honest.  I have only ever seen it used in regards to userfields directly, like reporter, assignee, or custom fields of type user.  

There is an outstanding feature request that relates directly to this topic in JRACLOUD-27594 - JQL search for @mentions.  This is not something that Jira has historically been able to do, so a feature request is more appropriate here than a bug ticket would be.   I would recommend voting that issue up.

I have reviewed this topic and I can't seem to find a valid work-around that exists for Jira Cloud today.  It seems there could be other 3rd party plugins for Jira Server that might help here to search on this, but Jira Cloud does not appear to have a working solution. 

I can see why this would be helpful to have.   I have tried to update that existing feature request to detail the problem here further and try to explain why this would be helpful.  Sorry I don't have a better answer right now for this one, but I would recommend watching this issue for updates.  I can't promise this issue will be worked anytime soon, but it feels like this ability could bring real value to lots of users.

Regards,

Andy

David July 12, 2019

Great, thank you for your (very detailed) reply! Atleast i have the knowledge that it is not supported (yet)!

hopefully we can get support sometime soon :) 

Like # people like this
Bharat Kini November 15, 2020

comment ~ currentUser()

seems to be working now...!

Like # people like this
Samantha Kaplan
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!
November 1, 2021

This still doesn't work for me it only shows a few select issues but definitely not all of them

beata.januszczak
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!
November 2, 2021

seems to be working for Confluence side but not Jira... my workaround is to use their mobile app - that's giving you all the @ mentions

Tahira Kauser
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!
July 23, 2023

I had same issue and it worked for me too

comment ~ currentUser()

marina_lavignasse February 16, 2024

I use:  text ~ currentUser()

and it works for me.

It also shows the issues you are mentioned in Description, not only in comments.

 

And if you want to filter mentions to a specific user/s I do the following:

1) assignee = 'username' or assignee in ('username1', 'username2')

2) I change 'assignee =' by 'text ~'

And it works too.

14 votes
Bharat Kini June 10, 2020

I tried the 

  1. Click on your user icon in the bottom-left corner and select "Profile"
  2. You'll need your User ID - this is the long alphanumeric sequence after "/people/" in your URL bar - copy and paste this
  3. Go to the issue search page and press "Switch to JQL" if in basic search mode
  4. Now in the search bar, put in "comment  ~ <<your User UD>>" and press Search

BUT "comment  ~ <<your User UD>>" didn't work for me on JIRA clouds

HOWEVER when I changed it a bit as shown in the below line it did work ->

SOLUTION --> comment ~ '123456'

(For example sake please consider my user ID as 123456 and yes I used single quotes before and after my user ID)

Kathryn Martinez
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!
July 7, 2020

This worked great!  I was able to use it to find comments for another user, I viewed their profile and grabbed the end of the URL after "users/"

 

Thanks!

Like # people like this
Jim Ryan August 3, 2020

It seems this only works with specific users. Is there any way to make this work with currentUser()?

John Elstad
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!
August 21, 2020

This worked for me, too! Thanks for the tip.

Like Bharat Kini likes this
Bharat Kini November 12, 2020

Hey @Jim Ryan  have you tried -> assignee = currentUser()

this one works for the current user in both JQL's and quick filters in JIRA cloud

Jim Ryan November 13, 2020

@Bharat Kini 

Thanks for the suggestion. However, your suggestion only finds issues that are assigned to the current user. The OP (and I) are looking for all issues where the current user is mentioned.

Bharat Kini November 15, 2020

Hey @Jim Ryan , have a shot at the below JQL, looks like it works for the problem statement you gave me.

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

The first parameter "comment ~ currentUser()" filters all the tickets across all projects which have the current user @ mentioned in the comments from the dawn of time.

The second parameter "updatedDate >= -3d" filters in only the recently updated ones cause I believe that's what most folks are interested in. In this case '-3d' stands for the tickets updated in the last 3 days.

Feel free to change the number 3 in the second parameter, which controls the time period or range of recent tickets you'd like to see.

Let me know if this helped ya.

Like # people like this
Kathy Barton
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.
May 5, 2022

@Bharat Kini that's the query I'm using but it has the problem that it finds any mention in the entire history of the ticket as long as someone has made an update in the last 3 days. So in the case where I was mentioned in a comment in 2020 but then the ticket was updated yesterday, it shows up in my filter, even though the actual comment with me in it was years ago. I've hunted all over but I can't find a way to filter on the date of the mention (on cloud). Have you ever seen anything like that? 

Like # people like this
Mikaela Bertucci
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!
November 7, 2022

try filtering to the current sprint 

Like George Grigorian likes this
George Grigorian
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!
March 17, 2023

that's a great idea @Mikaela Bertucci but I run Kanban for my DevOps team. I wish we were running sprints! I'll remember that for future other teams though! Thanks! 

5 votes
Jason Gainor February 17, 2020

This works:

text ~ "accountid:123456:1234567a-123b-123c-1234-123456789012"
Jesse Smith
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!
February 19, 2020

Thanks for this - for others trying to implement - capture the account id string above by creating a @mention on a ticket and then inspecting that link. Use that link as a text ~ "your-link-here" quick filter.

Like marina_lavignasse likes this
Lauma Cīrule
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.
March 13, 2020

Hi,

Thanks for this suggestion! I was trying to search in a custom text field for mention with the following query, but nothing was returned, though there should have been one issue. Am I missing something?

project = ProjectName AND fixVersion in (Version1, Version2) AND "Testing status" ~ "accountID:557058:e1f9e60e-8a47-4d93-8014-2b10add40d82" ORDER BY updated DESC

Lauma 

Jim Ryan August 3, 2020

This is useful, but is there any way to make it work with "currentUser()"? I need to create a dashboard that is shared across my organization that any user can view and see all the comments where they are mentioned.

Like # people like this
Fernando Stapf November 5, 2020

Isso mesmo, e inclusive você pode integrar com o Slack

slack.png

Like # people like this
1 vote
Ashley Gaza
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!
October 16, 2023

For anyone still looking for a workaround on this, Slack can notify you when someone mentions you in Jira.

  • In any Slack channel send a message with /jira notify
  • You will get a response with the following options:

2023-10-16 10 46 00.png

0 votes
Melanie Koeberle
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 26, 2023

No plugin needed and we have an older version of Jira. 
I decided to go current user route so as not to have to save a bunch of filters per team member. I also added an updated within the last 14 days criteria so it wouldnt be all comments ever.

comment ~ currentUser() AND status not in (done, Resolved, Closed, Accepted) AND updated >= -14d ORDER BY due DESC

 

Thank you, everyone!

Susan Keck
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!
January 18, 2024

How is this working for you?  So many tickets get updated after the tag I'm hoping someone has a way to just check for the dates of the comment that has the tag and ignore any other updates after.   So if I'm tagged on January 4 but there are comments days later - I only want the comment to be in the result if I query for a date range including January 4.


0 votes
Dhaval Khairnar June 16, 2022

We can also create a filter for others who are mentioned in the comments by below query

project = test AND status in ("Work in progress") AND reporter in (62123455678888) AND text ~ "1234565678678607". You can find the person's account id by selecting the user in assignee and switch to JQL query. You will get account id of that person.

0 votes
David Kesselring
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!
April 21, 2022

As of 2022 in our on premise instance, I can use "comment ~ [Username]" where [Username] is the user name from your profile.

0 votes
Benjamard Nittayapat July 22, 2019

Let's me know if a valid work-around is available.

hudziakp July 25, 2020

You can try plugin https://marketplace.atlassian.com/apps/1222753/user-mentioned-jql but it's only available for Jira Server.

Suggest an answer

Log in or Sign up to answer