Hi,
Is there a way to search tickets by who commented on them? I want to find tickets that a specific user has commented on. Is there a way to do that?
Or maybe search by watcher? Search tickets by a specific user who watches them?
In advanced search you can specify:
commentedBy = "user name" and then the rest of your search criteria.
For watcher specify:watcher = "user name" and then the rest of your search criteria.
This is a bit clunky, but you can export a set of issues to CSV and then search the comment field(s). Note that you can export at most 1000 issues, so narrow the search criteria until you're under that threshold. "Number of Comments" > 0 is a start. Perhaps limit to modified within the last year or something like that as well. Once you have your matching issues displayed, click Export in the upper right and then CSV (All fields). Open in Excel, etc. and look for the comment column(s). There will be a column for each comment, so if, for example, one of your matching issues has 10 comments, there will be 10 comment columns. You could then use conditional highlighting or a similar tactic to identify rows containing the username of interest.
Or, if you or your DBA can run a query against the database, you could easily tackle it that way as well. I for the most part stay out of the database, but sometimes a quick query can be a good solution to something like this.
SELECT concat(p.pkey,'-',issuenum) as issueNum,ja.CREATEDFROM jiraaction jaleft join jiraissue i on i.id = ja.issueidleft join project p on p.id = i.projectwhere actiontype='comment'and AUTHOR='USERNAME'order by ja.ID desc
Thanks for the quick reply.
"commentedBy" does not appear as an option for me in advanced search. It says "Field 'commentedBy' does not exist or you do not have permission to view it."
Is there any trick to turn it on?
I apologize, that is available via the ScriptRunner app. I should have verified that prior to posting.
https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira?hosting=cloud&tab=overview
Ah, I understand.
Thank you for the information.
Thanks Payne that is great, can you please help me add to this query the issue id , issue created date and issue assignee to the columns?
Here you go:
SELECT i.ID as issueId,concat(p.pkey,'-',issuenum) as issueNum,ja.CREATED as commentCreated,i.CREATED as issueCreated,ASSIGNEEFROM jiraaction jaleft join jiraissue i on i.id = ja.issueidleft join project p on p.id = i.projectwhere actiontype='comment'and AUTHOR='USERNAME'order by ja.ID desc
It looks like you're new here. Sign in or register to get started.