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

Eric Schranz October 19, 2018

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

0 votes
Steve Holmes June 22, 2022

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.

0 votes
Andrew
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.
October 19, 2018

Hi @Eric Schranz

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

Eric Schranz October 20, 2018

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.

Andrew
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.
October 20, 2018

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).

Eric Schranz October 22, 2018

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.

Thomas König September 5, 2019

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