Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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
4,462,024
Community Members
 
Community Events
176
Community Groups

Search for issues with comments by user and text

I'm searching for all Jira issues with comments written by a given user and containing some given text.

I'm already aware of how I can search for issues with comments by a given user, for example:

issueFunction in commented("by user@domain.com")

or, if looking for my comments,

issueFunction in commented("by currentUser()")

But I'd like to specifically filter by comments satisfying both conditions: author and content. How can I achieve this?

Queries like

issueFunction in commented("by user@domain.com") and comment ~ 'text'

of course don't satisfy my requirement.

Thanks in advance!

3 answers

1 vote

Hi @luca-pittino  and @Björn_Schotte 

I had tried this jql and get my favorite result

Comment ~ "\"text\"" and issuefunction in commented (" by user@domain.com")

Hi @Ashkan Malekly, I guess your case was a lucky combination :)

Your suggestion is basically the last query I wrote in my question above, with the difference you're searching `"text"` (quotes included).

My problem is that I need to match isses having single comments satisfying both conditions A and B, but I can only get issues with some comment satisfying A and some other comment satisfying B.

Hii @luca-pittino  

No in my code include ( \ ) this is important.

this is yours:          comment ~ 'text'

And this is mine :  comment ~ "\"text\""

Like Vera Dukic likes this

Sorry @Ashkan Malekly, I think I've been mislead by the fact that even using quotes I still got many results with comments not matching both conditions (false positives)..

Actually though, the amount of results with and without quotes is different (e.g. ~70 and ~120 respectively).

Maybe something related to Jira app version? I'm using Jira Server 7.1.4, maybe on later versions they did some improvements?

@luca-pittino  could you tell me the username and comment? I think you miss somewhere in the code. I want to implement your username and comment in my code give you back and please put it in your search bar. Thanks 

Does anyone know if there is a way to display the comment text in the results?

Like Pavel Melik likes this

It is necessary to search for text in the comment of a specific user.  i can't find a solution to such a problem in JQL.

issueFunction in commented("by user") AND comment ~ 'text'
- not satisfied with the results.

 

I want to have something like (fantasizing):

comment ~ 'text' ("by user")    //OR//   issueFunction in commented("by user  / text ~ blabla ")

?)

Hi,
it's complicate to manage some special chars for your condition  'comment ~' (escape with '\' or '\\' )

you have to escape the special chars ex: https://confluence.atlassian.com/jirasoftwareserver/search-syntax-for-text-fields-939938747.html#Searchsyntaxfortextfields-escapingSpecialcharacters

Hi Luca,

I do have similar problems. Did you solve the issue?

Not with a query unfortunately, nor with Jira filters.
I guess a search with similar expressiveness is unsupported at the moment.

In my case I searched by text, as I got the fewest results, and then manually checked the text occurrences and saw who the comment author was.

Suggest an answer

Log in or Sign up to answer