51

As per JIRA documentation http://www.atlassian.com/software/jira/docs/latest

The following filter will show the issues opned by me (Current User).

reporter = currentUser()

Is there a filer that will show issues commented by me? something like the following does not work...

comment by = currentUser()
shantanuo
  • 31,689
  • 78
  • 245
  • 403
  • If you're using JIRA Cloud - there is an [Add-On](https://marketplace.atlassian.com/plugins/jql-pro) that enables functionality you're looking for – Vitalii Zurian Oct 20 '14 at 22:04

11 Answers11

42

if you know the name of the user (lets assume the name is Tom you can do:

issueFunction in commented("by Tom")

you can also filter it by date of the comment like:

issueFunction in commented("after -1d by Tom")

UPDATE: this requires ScriptRunner being installed in JIRA server (as JBert pointed out)

Tomas Panik
  • 4,337
  • 2
  • 22
  • 31
  • 1
    In our JIRA 6.3.13 your query `issueFunction in commented("by Tom")` works. Although not in scope of OP question it would be nice to [be able to search on issues I have commented](https://jira.atlassian.com/browse/JRA-1648) without additional plugins.. – surfmuggle May 22 '15 at 12:36
  • 5
    This answer should mention that it is not standard JIRA functionality, instead it depends on Adaptavist ScriptRunner being installed. – JBert Sep 28 '17 at 08:30
  • Please edit, as @JBert pointed out, stating that you need ScriptRunner – Rob B Mar 06 '18 at 14:25
  • Adding the link to the documentation (https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+JQL+Functions#ScriptedJQLFunctions-commented(commentquery)) as in the answer by @herrphon would be of additional help. – Thomas Apr 09 '19 at 06:20
10

You can use the Activity Stream gadget with a filter configured by username and activity type. Note that this requires a case-sensitive username, not the friendly Display Name.

Activity Stream gadget configuration: Activity Stream gadget configuration

Filtered Activity Stream display: enter image description here

(I posted a variation of this answer elsewhere but have improved my filter since then and the new filter is more salient to this question anyhow.)

Community
  • 1
  • 1
Dannid
  • 1,507
  • 1
  • 20
  • 17
7

You could also follow the approach presented by Matt Doar:

Use a participants field from the JIRA Toolkit plugin and query that

http://confluence.atlassian.com/display/JIRA/Advanced+Searching?focusedCommentId=229838922#comment-229838922

It's not a a complete answer but maybe a step in the right direction... Francis

Francis Martens
  • 3,458
  • 4
  • 24
  • 26
6

I had the same problem and

issueFunction in commented("by username") 

worked for me

The following query identifies tickets in which current (or some other particular) user was mentioned in comments:

comment ~ currentUser()
Alex M981
  • 2,264
  • 14
  • 24
  • What did I comment on in the last two weeks (not this week): `issueFunction in commented("by currentUser() before startOfWeek() after startOfWeek(-2)")` – bshirley Jan 31 '23 at 21:58
  • `issueFunction` is not built-in parameter, you need paid extension *Adaptavist ScriptRunner* to be installed – gavenkoa Jun 02 '23 at 09:01
5

For filtering issues in which you have been mentioned, try comment ~ currentUser()

kp91
  • 1,168
  • 10
  • 14
  • This works without any plugins or database access and exactly answers the question. I recommend `comment ~ currentUser() ORDER BY createdDate DESC`. – Noumenon Sep 08 '17 at 16:41
  • i think this actually only shows the results with comments that have @YourUsername in the actual comments, it doesnt have results for issues you comment on – user1689987 Jun 21 '23 at 02:29
5

In JIRA v7.3.0, the watcher field works well, if autowatch is enabled:

watcher = currentUser()

How to enable Profile > Preferences > Autowatch : [inhert, disabled, enabled]

Issues that you create or comment on will automatically be watched for future changes.

Justin Wrobel
  • 1,981
  • 2
  • 23
  • 36
4

The new scriptrunner can do lots of things e.g. find issues with comments issueFunction in hasComments(), find issues with comments that are not older than 7 days issueFunction in commented("after -7d") and also issue comments from users or groups.

Details can be found here: https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+JQL+Functions#ScriptedJQLFunctions-commented(commentquery)

herrphon
  • 41
  • 2
4

You can try that workaround I am current using this expression on my saved search:

comment ~ "your.username.here"

This in fact catch the comments where I was mentioned, but if you mention yourself probably should works. I have not tried by myself.

My current Jira is a cloud based one, so I can't tell you exactly which version is.

  • This should be the most upvoted answer since it doesn't require add-ons and is by far the most elegant solution. – John Suit Aug 03 '21 at 13:48
2

If you're talking only about the current user, there is a personal Activity Stream in your profile

https://xxx.atlassian.net/secure/ViewProfile.jspa

It includes actions other than comments, but does provide an RSS feed which you could filter only comments with:

<category term="comment"/>
Jono
  • 3,949
  • 4
  • 28
  • 48
2

This (to my knowledge) cannot be completed using JQL, even with a plugin. If you have DB access, the query is simple:

SELECT pkey, summary FROM jiraissue, jiraaction WHERE jiraissue.id = jiraaction.issueid AND author = '<insert_jira_username>';
Justin
  • 597
  • 4
  • 7
  • #This is the query I was looking for. Thanks # SELECT a.pkey, a.summary FROM jiraissue AS a left join jiraaction AS b on a.id = b.issueid where b.author = 'jira_username' OR a.REPORTER = 'jira_username' OR a.ASSIGNEE = 'jira_username' group by a.pkey order by a.CREATED – shantanuo May 27 '11 at 09:45
1

This is the query to know the issues I am involved in:

SELECT a.pkey, a.summary FROM jiraissue AS a left join jiraaction AS b on a.id = b.issueid 
where b.author = 'jira_username' OR a.REPORTER = 'jira_username' OR a.ASSIGNEE = 'jira_username' 
group by a.pkey order by a.CREATED

This is the query to know all issues raised in the last 24 hours.

select REPORTER, SUMMARY from jiraissue 
WHERE CREATED > DATE_SUB(CURDATE(), INTERVAL 1 DAY)  order by CREATED DESC; 
shantanuo
  • 31,689
  • 78
  • 245
  • 403