get a specific user's comments in Jira 8.5.0 - jira

I use Jira Server, I am trying to get a specific user's comments in advanced search with JQL. I don't want to use plug-ins. In other posts (which are mostly for Jira Cloud) I ve seen and I tried these:
comment ~ "user.name", comment ~ user.name, comment ~ currentUser(), comment ~ currentUser() OERDERBY createdDate DESC or issueFunction in commented("by user")in this and this posts.
However none of these return a result, what I see is:
No issues were found to match your search
Does anyone use Jira Software 8.5.0 Server and experienced such issue ?

I tried using issueFunction method and it does return me list of issues commented by an specific user.
For example, my user name is vikkumar then the syntax will look like this
issueFunction in commented("by vikkumar")
Let me know if this works.
Thanks.

Related

JQL : show last updated tickets but not by me

In JIRA I would like to show the last updated tickets (ORDER BY updated DESC) that were updated by someone that isn't me (filter).
Is there a way to do it?
Thanks in advance.
There no way to do this with JQL. Only update date is stored.
The closest you can get is using "was" which can be used with status changes or resolution, for example to query something like: status was closed by bob
If you use scriptrunner you also get a similar function for comments: issueFunction in commented("after -4w by jbloggs")
And for work logged: issueFunction in workLogged(on "2015/07/28" by admin)
But probably this would be the closest to what you are looking for:
lastUpdated (by / inRole / inGroup) Finds issues by the user who last
updated them. Example, find all issues that were last updated by
members of the Developers role:
issueFunction in lastUpdated('inRole Administrators')
Hope it helps you

Search Jira for open tickets with my name commented somewhere in the ticket

I am trying to create a custom search for Jira looking for tickets that have had my user name commented within the tickets but only including tickets that are open in some way. These could be any kind of ticket.
The search I have tried is
(summary ~ currentUser() OR description ~ currentUser() OR comment ~ currentUser()) AND (resolution != Done OR resolution != Fixed)
However this is returning a list that includes done and fixed tickets.
A new better search or a suggestion as to how to improve the search above would be great.
The main field for opened/closed tickets to check is status. resolution is not accurate enough. You can use the following search:
(summary ~ currentUser() OR description ~ currentUser() OR comment ~ currentUser()) AND status != Done AND status != Closed
It will look for your user in any of these fields: summary, description or comment and retrieve tickets that are not done nor closed.
Hope it helps!

Jira - JQL "WAS" Operator

Im trying to search for all the issues assigned to an user, but no results are being returned and i cant figure out why.
My JQL is the following:
project = MYPROJECT and assignee was joaoalves
In the docs it says:
The "WAS" operator is used to find issues that currently have, or previously had, the specified value for the specified field.
(Note: This operator can be used with the Assignee, Fix Version, Priority, Reporter, Resolution and Status fields only.)
I have an issue assigned to the user joaoalves, but when i search with the JQL above no issues are returned.
But if run the following JQL the issue is returned:
project = MYPROJECT and assignee = joaoalves
Am i missing anything?
It works in my instance, and return issues that currently or previously assign to me. Which version of JIRA are you using?
Assignee was will return the issues which were previously assignee to tat user and current tickets which are present on that user.
Try in conjunction with the "DURING" clause and specify a timeframe. Like this -
project = MYPROJECT and assignee was joaoalves DURING ('2017-04-16 23:59', '2017-04-19 23:59')
See: https://confluence.atlassian.com/jiracore/blog/2015/07/search-jira-like-a-boss-with-jql
The was operator is looking for issues where the assignee was joaoalves but is currently not that user.

How to find jira issues with componets lead by the current user?

I tried to use the following jql but it resulted in jql validation error:
component in componentsLeadByUser( currentUser() )
Error in the JQL Query: Expecting ')' or ',' but got '('.
When I replace the currentUser() with concrete user names, it works well. but i would like to create an universal filter for all users for a shared dashboard.
Could you please help me with this question?
According to documentation "Advanced Searching Functions"
You can optionally specify a user, or if the user is omitted the current user (i.e. you) will be used.
Therefore to find jira issues with componets lead by the current user:
component in componentsLeadByUser()

Issues commented by me in JIRA

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()
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)
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:
Filtered Activity Stream display:
(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.)
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
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()
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)
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.
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.
For filtering issues in which you have been mentioned, try comment ~ currentUser()
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>';
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"/>
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;

Resources