Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

JQL - Find Issues Where I Was Mentioned in the Past Two Weeks

I'm trying to filter to issues where I've been mentioned in a comment and that comment happened in the past two weeks. I've tried the following...

comment ~ currentUser() 
and issueFunction in commented('after -14d')
order by updated desc

 ...but this pulls in any issue that had a comment during the past two weeks, regardless if I was mentioned in them during those two weeks. For example, for a query run on 2018-10-19, I would not want to see issues where I was mentioned in a comment on 2018-10-01, because that would be more than two weeks ago.

An ideal function would only look within the comments being filtered for the past two weeks:

issueFunction in commented('text ~ currentUser() after -14d') 
order by updated desc

 Does JQL have this functionality? Thanks for your help!

2 answers

project in (project) and commentedOnDate > startOfWeek(-14d) and comment ~ currentuser() ORDER BY created DESC

I have used this to great effect. It works because it processes the project and comments date prior to checking for the mentions. So the order of operations matters here. If you had the Comment ~ currentuser() first it would find all your mentions before filtering on the ones with recent comments which may or may not have you tagged.

Hi @Eric Schranz

Maybe that:
comment ~ currentUser() and updated > startOfDay(-14d)

That still brings in the same issue unfortunately. There was a comment as recent as yesterday, but the comment where I was mentioned was more than two weeks ago.

Looks like your JIRA recognize AND as OR. Which version of JIRA? Use some plugins for JQL?
Try this JQL

updated < startOfDay(-4d)  and created > startOfDay(-3d)

after that result must be empty

updated < startOfDay(-4d)  or created > startOfDay(-3d)

after that filter must show some issues.

Try restart JIRA and disable plugin(if using for JQL).

I'm not a Jira admin, so I can't do any restarting. The issue I'm running into, I believe, is that there are no comment functions that look at specific comments. The issueFunction appears to take the issue as a whole.

Did you find a solution for your problem? I think the above jql simply doesn't work because the 2 parts of the query work independently. So the query is looking for all issues that have your user name in some comment and that have been updated during the last 14 days. However, nothing in the query says "only if the comments from the last 14 days contain my username".

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you