JQL query to fetch a list of tickets touched by a list of users - jira

I have a team of 8 members and have a requirement to list the tickets touched by them in the last week . Please help.
assignee was in (x,y,z) AND created <=-15d AND updated <= -15d

I beleive this is what you are looking for.
assignee was in (x,y,z) AND (created <='-15d' AND updated <='-15d')

The answer above is working but quite simple. If someone needs something more complex jql query that covers different activities related to the jira issue ticket (commenting, changing status and reporting an issue), you can use this:
status changed BY (x,y,z) DURING (startOfDay(-7d), startOfDay()) OR
assignee was in (x,y,z) DURING (startOfDay(-7d), startOfDay()) OR
reporter was in (x,y,z)
There are some limitations for further options, e.g.:
history searches do not support the worklogAuthor field,
you have to repeat and expand issueFunction piece into several OR parts in order to filter by several users in comment section
but if you would not mind them you can expand it even more to cover also comments and worklog:
issueFunction in commented('by x after 2023-01-01') OR
status changed BY (x,y,z) DURING (startOfDay(-7d), startOfDay()) OR
assignee was in (x,y,z) DURING (startOfDay(-7d), startOfDay()) OR
reporter was in (x,y,z) OR
worklogAuthor in (x,y,z)
And you could improve it and expand it even more...

Related

Jira Plan Board: filtering by label hides epics and story points

I have a Jira Scrum board and when I use the following JQL query for it, I cannot see the epics or story points in the plan board:
Team in ("Team 1", "Team 2") AND labels in (sprint8-candidate) ORDER BY Rank ASC
but if a remove the label condition, then I can see the epics and story points:
Team in ("Team 1", "Team 2") ORDER BY Rank ASC
Can anyone explain why filtering by label would hide the epics and story points?
Update: as per Barnaby's comment, I can see the Epics if I change the query to include them:
(labels in (sprint8-candidate) OR type = Epic)
But I still can't see the story points per issue:
Update #2: the story point issue was because someone in my org has set up a second story point field and I was displaying the wrong one in the board Configuration Estimation settings.
Remember that in JIRA epics are just another issue type.
The query that selects based on labels is only going to associate issues to the board that have the label in them. If the epics don't have the label then they will be excluded.
You could add the label to the epics. But I'm not sure if this would be what you want.
It may also be possible to formulate the JQL to include all epics, but just the stories that have the label.
Barnaby already explained how to display the epics as well. The fact that you don't see story points is probably because those are not displayed for just any issue type.
I think your screenshot displays features (the ones with the + icon) and bugs (the ones with the o icon), but by default only epics and stories will display story points. You can associate other issue types with estimates in story points as well. How to do this is documented here. Look for Story Points.
Estimation will be based on the number of Story Points per issue. This is the most commonly used option.
By default, the Story Points field is only available to issues of type 'Story' or 'Epic' (not 'Bugs' etc). If you want to change this, do the following:
Associate the Story Points field with other issue types, see custom field context (JIRA Admin documentation).
Specify the screens that the Story Points field should be displayed on, see Defining a screen (JIRA Admin documentation).

Filtering issues in next Sprint

I have the following filter to find issues in current Sprint:
resolution is EMPTY AND assignee = currentUser() AND Sprint in openSprints() ORDER BY priority DESC, created ASC
It works as expected. However, our team creates separate "sprint" (in futureSprints()) for stretch goals and I'm unable to query them without picking up the rest of the backlog. However, this stretch goal sprint is always the next one in our list. Moreover, if current sprint is called "Sprint 20-2016", the stretch goals will be called "Sprint 20-2016 Stretch Goals". This means that I can retrieve the stretch goals by grabbing the name of the current sprint. For example, the following hardcoded solution works:
resolution is EMPTY AND assignee = currentUser() AND Sprint in futureSprints() AND Sprint = "Sprint 20" ORDER BY priority DESC, created ASC
Problem is that instead of "Sprint 20" being hardcoded I want something like Sprint = [name of first entry from] openSprints() but don't know how to express this in JQL. Alternatively, since stretch goals are always in the next sprint, something like Sprint in [first entry in] openSprints() + 1 would work as well.
Adaptavist Scriptrunner adds a plethora of extra JQL functions.
One of which is nextSprint
nextSprint("Board Name")
I use it to generate statistics for our next planned 3 week sprint as well as feed a dashboard for users that complete their work early and are looking to pull issues from the next sprint into the current. Generally we pull by stack order, but with as much dynamic work as we have a dashboard gives us a bit more flexibility that a scrum board doesn't offer.
How about:
(sprint in openSprints()) AND (sprint not in futureSprints())
I wish I could find a way to reference the next 'top' of the board Sprint. However, I think if you are using a naming convention, like Stretch Goals', I would put my filter as
Sprint = Stretch Goals and sprint=futureSprint()
I tried using the word Like, but found out that it is not supported and JQL as it is does a 'Like' search. Using the FutureSprint() check you will not get

JQL expression to select all epics that contain recently updated stories

Is it possible to structure a JQL expression to select all epics that contain stories updated within the last 2 days? If so, what would this expression look like?
This is not possible just the way you want it, but you can select all stories that have epic link and that are changed within the last 2 days. Then adding "Epic link" column to search results you can easily see which epic they belong to.
JQL:
issuetype = Story AND "Epic Link" is not EMPTY AND updatedDate >= -2d
If you really need this the way you asked, you could try to look into JQL Tricks Plugin https://marketplace.atlassian.com/plugins/com.j-tricks.jql-plugin/server/overview it may have this behaviour implemented.

Jira Agile: How to report by Epic, by Story/Parent, by Subtask?

I would like to get a summary report of my sprints and what happened with my tickets. I'd like to see aggregations by epic, then by story, with the leaf level being the subtickets on a story item.
Is there any way to do this? I Can get the particular sprint's information, but that's as far as I've gotten.
project = "ADS Agile" AND assignee = MYNAME AND resolution in (Completed, Fixed, "Cannot Reproduce", Approved, "Won't Fix", Duplicate) AND sprint = 100 AND resolution = Completed ORDER BY summary ASC, key ASC
//edit Example output;
T Key Summary Assignee P Status Resolution Created Updated Due Time Spent Original Estimate
Sub-task AGILE-35
AGILE-30 (New) Decide whether to use existing system.
Anne Normal Closed Completed 01/12/15 01/15/15 2 hours 2 hours
Story AGILE-31
As the PO of ss, I'd like tests for each path.
Anne Normal Closed Completed 01/05/15 01/29/15 1 week, 4 days, 1 minute 4 days, 4 hours
Probably the easiest way to do it would be to run the query you have now and then export it to Excel. You should be able to do the aggregation you want within Excel.
In the list of query results, select the columns you want before exporting to .csv. Easier than eliminating from Excel.
Reorder and organize the columns as you wish before the export as well.
Then save the query so that it appears as you wish.
Jira will never display the stories -under- the epic, which is very frustrating. But displaying the name of the epic link will do the trick.
Realizing that the original poster certainly figured this out a year ago, but thinking that others might have the same question.

Jira JQL equivalent to Group By

I'm trying to pull a report, (a pie chart or just a list) on amount of assigned issues in the last month by assignee.
Also is there any way to do an average age report, but per user as well?
The Group By part comes from using the Issue Statistics gadget to summarize a report by a particular field such as Assignee. Most but not all fields appear in the list of fields to summarize by.
~Matt
Not sure if this is what your looking for:
Go in to Issue and query for createdDate >= -30d, this will give all issues created in past 30 days.
next go to views>pie chart>Save to dashboard add filter name
Then you can edit the statistic type to display by assignee.
In addition to Matt's answer, you can also use a 2 dimensional filter statistics, which is more detailed.

Resources