How can I search issues to which a user has commented?

philippos January 10, 2013

Hello,

I want to search all issues to which I have entered a comment. Recently or in the distant past.

How can I do this?

Thanks

13 answers

1 accepted

12 votes
Answer accepted
JamieA
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.
January 10, 2013

Also commented jql function in script runner.

This will just find issues where the specified user commented, and not "participated" in as the Participants field gives you.

I appreciate you can't install plugins but maybe someone else has the same question.

AFAIK you can't do it without a plugin.

philippos January 20, 2013

I assume I can use JQL to search for all issues that have been commented by a user?

Maybe

issueFunction in commented("by User1")

How can I use JQL on a Jira installation? Thanks.

Like # people like this
Peter Kahn
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.
February 11, 2016

Is there anyway to push currentUser() into that?  I didn't see that as an option since I need to put it in quotes.  Unless jql support groovyString like notation ${currentUser()}

JamieA
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.
June 23, 2016

issueFunction in commented("by currentUser()")

works fine in recent versions.

Like # people like this
Chuck Vanderwist October 12, 2017

Can this be done with "by Reporter" somehow?

Like # people like this
Chris Nowaczyk March 25, 2021

If you want to delete internal users you can use this JQL to find the issues where they commented or assigned in some way:

 

issueFunction in commented("by user") AND (assignee = user OR reporter = user )

 

53 votes
David Skreiner
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.
June 23, 2016

As a workaround, you can use a dashboard:

1 open Dashboard
2 Add Gadget Activitiy Stream
3 Add a global filter: Project is XY
4 Add a global filter: User is (username)
5 Below the Global Filter, klick JIRA - Add Filter:  Activity is Comment
6 Set "limit to 99 items"

You now have the comments as an activity stream.

B December 2, 2016

Excellent work around without plug-ins!!

 

Thanks David!

-Ben

Shivalingesh Hosagoudar June 16, 2017

+1

Tracy B June 20, 2017

total lifesaver, thank you

Tommy Rowe December 9, 2017

Has anyone else noticed that Global Filters is now missing - Activity Streams are now all Beroke. 

Raj Kumar Panuganti October 15, 2018

David Skreiner, Thank you very much for putting those steps. Its immensely helpful.

Cyrus ziaei October 24, 2018

The above solution works only for parent bug, how about if you want to search in subtask and in particular release?

Ted Karakekes November 9, 2018

This is powerfull work

Caitlin Murphy April 29, 2019

Is there a way to make this only appear to a specific user? 

Doug Kozar July 16, 2019

Perfect @DavidSkreiner!

David Willson December 2, 2019

Worked! Thanks. I'd say this is the most straight forward answer.


David

David Willson January 28, 2020

Totally worked.

Bastian Wedler March 2, 2020

Thank's a lot! Works fine.

GM April 16, 2020

nice solution.  

Romeo Tomescu October 9, 2020

Not working for me. I'm adding the project and when I add the second filter (User is) I don't get any relevant results. I say relevant because it is not displaying anything (any suggested user names). Even so, if I click on Save, it does not display any results. Even if I add one of my colleagues (who I know for a fact commented on issues)

kristijan.jovanovski October 13, 2020

@Romeo Tomescu the username field is case sensitive, copy the username from the user profile and if your setup is correct, the values will be represented. 

Romeo Tomescu October 13, 2020

Myeah. Working now. Not sure how I missed that. I needed to write the username and then hit enter, instead of waiting for the system to show me suggestions. 

 

A clear case of obviously dumb simple, what can I say :)

Rob van den Belt November 18, 2020

One word; brilliant!

Subbu May 10, 2021

Not sure what am I missing.  It is not finding comments added by me.  I am copy pasting my name from profile.  If I choose username is not, it is showing comments added by me (along with comments added by everyone else).  So obviously some problem with the username I am entering.

1 vote
Romeo Tomescu March 4, 2020

Sorry to barge in like this, but is there any update on this issue? I cannot take out a user from the company account and Jira reports that there are 2 comments associated with his name. Of course, I cannot find those comments.

 

Did anyone solve this properly?

Amir Katz (Outseer)
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 4, 2020

See my two suggestions above (Jun. 20, 2019)

Romeo Tomescu March 11, 2020

and, for some reason, I don't have it in my plugins list. Multiple attempts to install, same outcome.

1 vote
kostia@playtagon.com November 24, 2017

Does somebody know how to do it (find user comment id and issue id) using an JIRA REST API?

Amir Katz (Outseer)
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.
April 22, 2019

Yes. You send a JSON file asking for issues and in the fields you specify "comments" (see below), and you get back a JSON file with a list of comments for each issue. 

The data for each comment contains the comment ID, the author details, the body, the updater details (if comment was updated) and the dates (created, updated).

The input JSON would be like this:

{
"jql": "project = \"My SOSP Project\" AND key >= SOSP-1 AND key < SOSP-1001 order by key asc",
"maxResults": 1000,
"fields": [
"summary",
"comment"
]
}
Like Lynn PCD likes this
1 vote

You can view JIRA Comment Toolbox . To search on author of the comments with or without date range.

  • Commented By User
  • Commented By User Between Dates
  • Commented By Group Member
  • Commented By Group Member Between Dates
  • Commented By Role Member
  • Commented By Role Member Between Dates


Moreover, you can use JIRA Comment Toolbox for these;

  • Custom Comment Fields,
  • Custom JQL function
  • Delete issue comment
  • Delete user all comment
  • Update author of the comments.
1 vote
Deleted user October 20, 2014

For JIRA Cloud you can use JIRA JQL Pro Add-On

1 vote
Andrey Markelov
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 3, 2013
1 vote
Renjith Pillai
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.
January 10, 2013

Generally the Participants fields from JIRA Toolkit plugin is sufficient for this, while this includes all issues in which you have participated (not just commented, like editing)

philippos January 10, 2013

Can you please guide me as per how to use JIRA toolkit?

I do not see in my Advanced Search a "participants" field.

Thanks.

Renjith Pillai
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.
January 11, 2013

I read your reply to Joe's comment. I am afraid that you cannot achieve this without a plugin.

philippos January 20, 2013

Can I alternatively use JQL to query Jira database? Maybe via SQL on the underlying Oracle database?

Renjith Pillai
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.
January 21, 2013

Sorry, missed your earlier comment. What is the issue in searching with participants field in JQL?

EDIT: And JQL is not for direct database queries. It is for searching within JIRA.

0 votes
vigentatincyan1 September 6, 2020

1

0 votes
Amir Katz (Outseer)
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.
June 20, 2019

There is no way to search, AFAIK.

There are two options that I have used:

1. If you have the add-on Better Excel Exporter for Jira, you can run a query and export the results+comments into an Excel file.

2. Use the Jira REST-API to perform the query (as you specified above). In the list of fields to retrieve, specify the summary, comments and any other fields that you want.

Then write a script to find the comments you're interested in.

The input json would be similar to this:

{
"jql": "project = \"X Y Z\" AND worklogDate >= startOfMonth() order by key asc",
"maxResults": 1000,
"fields": [
"summary",
"comment",
"attachment",
"status"
]
}

for every issue, you get the key and the fields you asked for. For the comments, it's a list of the issue's comments, each item containining the author, date, body and some more data.

I use the latter approach.

0 votes
Salim Chikh June 19, 2019

Hi, 

 

I want to know how can i check the name of who imputed with a empty comment in a ticket, 

 

Like

project = XXX AND worklogDate >= startOfMonth() AND labels = XXX 

 

But i want the name of all people who comment and not just the tickets, any solution for this ? 

0 votes
Juby John October 3, 2017

You can use an add-on Essential Custom Fields for JIRA.

0 votes
Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 10, 2013

After you install the toolkit you need to define the field as a global field. It doesn't need to be on any screen to be searched though. However, it will only capture data from after it is defined.

philippos January 10, 2013

Thanks I cannot use this.

The Jira I work on is managed by a customer. So I cannot ask for such tools to be added.

Like Flash_Sheridan likes this

Suggest an answer

Log in or Sign up to answer