205

We use Jira extensively in our project, but I often have a hard time finding issues, that I know, I have been working on earlier. Usually, if some case is reported, that seems familiar to something I have been working on in the past, but I don't remember exactly what and when.

Usually, an issue is reported, then our scrum master assigns it to the developer, the developer fixes it (hopefully) and then passes it to the tester (yay, it works!). But then it is no longer assigned to me, and I have a hard finding old issues, that I remember vaguely.

I thought, perhaps it is possible to see the assigned history of an issue, there might be a way to form an advanced search/filter, that finds all issues, that at some time has been assigned to me.

Has anyone done this?

Alex Kulinkovich
  • 4,408
  • 15
  • 46
  • 50
erikric
  • 4,049
  • 8
  • 32
  • 44

12 Answers12

302

This is meanwhile possible by means of the JIRA Query Language (JQL) operator 'WAS', which has been introduced in JIRA 4.3 and extended in JIRA 4.4 to cover assignees and reporters as well, for example:

project = "Angry Nerds" and (assignee was 'johnsmith' or reporter was 'johnsmith')
Steffen Opel
  • 63,899
  • 11
  • 192
  • 211
Daria Trainor
  • 5,545
  • 4
  • 23
  • 30
  • 6
    It appears that this answer was provided significantly after the question was asked, but it should be the accepted answer going forward with newer versions of Jira (4.3 was release March 2011). – Jared May 14 '12 at 13:44
  • Does the `was` keyword also return a result if the user is the current assignee/reporter? (and say the issue didn't previously have an assignee, or they were the first assigned ever to that issue) – nmz787 Sep 10 '15 at 00:24
  • and what about ordering by last time I worked on it ? – sashok_bg May 02 '16 at 13:01
  • 2
    Did the syntax change? I only find it via `assignee in ("johnsmith")` – Thorsten Niehues Apr 11 '17 at 09:52
  • 2
    @nmz787 I tested that the `was` keyword includes currently assigned issues. – Bernard Vander Beken Jul 13 '17 at 12:38
38

General-purpose query for whichever 'current user':

assignee was currentUser()

This filter can be conveniently shared & anybody can put it on their dashboard, etc and it will return results specific to them.. Not supported on all old JIRA versions though.

This was my most-requested JIRA feature ever.

Thomas W
  • 13,940
  • 4
  • 58
  • 76
24

Check out JIRA Toolkit plugin - Participants custom field

https://studio.plugins.atlassian.com/wiki/display/JTOOL/JIRA+Toolkit+Plugin

This field allows you to easily track issues that you've "participated in". These are defined to be any issues you've commented on, raised or are the current assignee. See also the [JIRA Extended Participants] plugin.

Sam Hasler
  • 12,344
  • 10
  • 72
  • 106
Francis Martens
  • 3,458
  • 4
  • 24
  • 26
20

Update

This works without plugins:

assignee was currentUser() OR reporter was currentUser() ORDER BY updated DESC

The original answer

This query worked for me:

Participants = currentUser()
warvariuc
  • 57,116
  • 41
  • 173
  • 227
  • 1
    I tried it but got a message "Field 'Participants' does not exist or you do not have permission to view it." That's with Jira v6.0.6#6105-sha1:9713ad1. – Craig McQueen May 26 '14 at 06:08
  • @CraigMcQueen, I am not a Jira guru, but I think you need to install [JIRA Toolkit Plugin](https://ecosystem.atlassian.net/wiki/display/JTOOL/JIRA+Toolkit+Plugin) – warvariuc May 26 '14 at 06:17
7

try "assignee was username". it would get all tickets been assigned to the user before.

Jackie
  • 25,199
  • 6
  • 33
  • 24
5

You can find issues by worklog entries directly in the database:

select distinct ji.pkey from jiraissue ji inner join worklog wl on ji.id=wl.issueid where wl.author='some_username';

I agree this should be implemented in the UI though.

AJ.
  • 27,586
  • 18
  • 84
  • 94
  • As a developer, I don't have access directly into the db unfortunaltely. Is it possible to do this through the advanced issues search in some way? – erikric Jan 28 '10 at 08:20
  • Like i said in my comment, searching on the worklog is not supported yet by Jira. Please vote for it here http://jira.atlassian.com/browse/JRA-12312 – Hugo Palma Jan 28 '10 at 09:24
  • Is this the best answer for Jira < 4.3? We are stuck with an old version because of certain requirements. – k-den Oct 07 '14 at 23:49
4

For those that will be using JIRA 5+, there is also CHANGED operator that looks at the field changing to specific value within specific time range.

assignee CHANGED TO currentUser() AFTER startOfYear() BEFORE now()

More here: https://confluence.atlassian.com/display/JIRA052/Advanced+Searching#AdvancedSearching-CHANGED

Just another way how to achieve the same result, but might be useful for other cases.

peepa
  • 166
  • 1
  • 5
3

was is not supported to assignee field when I tried recently. You must use CHANGED, FROM, TO keywords to filter.

I'm using something like this:

project = MindBlowingProject AND (assignee in (currentUser()) OR assignee CHANGED from (currentUser()) OR reporter in (currentUser())) ORDER BY updated DESC
Dinesh Raja
  • 8,501
  • 5
  • 42
  • 81
2

So there are 3 scenarios: 1 - I changed it in some way - assignee changed by [UserName], 2 - I changed the status ( closed it, whatever) - OR status changed by [UserName], 3 - I still have it - OR assignee = [UserName]

So the whole query (assuming that the changed statement is allowed is:

assignee changed by [UserName] OR status changed by [UserName] OR assignee = [UserName]

SimonN
  • 383
  • 1
  • 2
  • 13
0

I think the most sensible approach is to search the issue-history. The only thing, that is not logged there, is who accessed the issue (just watching, without changing anything).

But you can't search the ticket-history without database access (as far as I know, please correct me if I'm wrong)

So, to search all issues with "someUserName" in the issuehistory, you have to inner join the table changegroup (and maybe the table changeitem from there).

Example:

select ji.id,issuenum,summary,creator,assignee,ji.created,updated,c.id as histid,c.author from jiraissue ji inner join changegroup c on ji.id=c.issueid where c.author like 'someUserName';

c.id as histid ==> this is the number/id of the entry in the (issue-)"History" tab

Meaning: if there ever was a change by the user "someUserName" it is logged in the History and it will be listet with this query

The following example will just list every disting issue, where the "myusername" was found in the History after the date 20180501:

select distinct ji.id,issuenum,summary,creator,assignee,ji.created,updated,c.author from jiraissue ji inner join changegroup c on ji.id=c.issueid where c.author like 'myusername' and ji.created > '2018-05-01T00:00:00.000';

I annotated the necessary relation here: enter image description here

MacMartin
  • 2,366
  • 1
  • 24
  • 27
0

From menu select Tempo->Reports

Select date-range

and you should see report.

Vijay
  • 2,021
  • 4
  • 24
  • 33
-1

I tried the below SQL query and it gives data of all the issues and all the assignees that were ever assigned to an issue. Any change in the assignee for any issue is captured by below query:

select distinct
p.pkey +'-'+cast(ji.issuenum as varchar(max)),
ji.SUMMARY,
cast(ci.OLDSTRING as nvarchar(max)) as 'Old value',
cast(ci.NEWSTRING as nvarchar(max)) as 'New value'
from
jiraissue ji
join project p on p.id = ji.PROJECT
join changegroup cg on cg.issueid = ji.id
join changeitem ci on ci.groupid = cg.id and FIELD = 'assignee'

Anyone looking for the query would find this useful : )

-Neha 'D' Pal

Neha Pal
  • 1
  • 1