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,553,478
Community Members
 
Community Events
184
Community Groups

Get the Stories & Subtasks with Status not in Done or Done in current sprint

Hi,

 

I'dlike to query the Stories & Subtasks in open, future sprints and in blacklog which status is not in (Done, Won't Fix) or Done in open/future sprints.

When I tried: 

project = TIME AND issueType in (Story, Subtask) AND (Sprint in (futureSprints(), openSprints()) OR sprint = EMPTY) ORDER BY Sprint ASC, issueType ASC

It gets all the subtasks even they are Done and not in open or future sprints.

If I tried:

project = TIME AND issueType in (Story, Subtask) AND Sprint not in closedSprints() ORDER BY Sprint ASC, issueType ASC

It will not get the subtasks although all of our subtask has sprint field.

1 answer

0 votes
Walter Buggenhout _ACA IT_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 08, 2023

Hi @Imba,

If you want to exclude done items, you'll need to make that explicit in your filter statement. Have you tried something like this?

project = TIME AND issueType in (Story, Subtask)
AND (Sprint in (futureSprints(), openSprints())OR sprint = EMPTY)
AND Status not in (Done, "Won't Fix")

 Hope this helps!

Thank you @Walter Buggenhout _ACA IT_  But it is not what I need.

I mentioned "status is not in (Done, Won't Fix) or Done in open/future sprints".

I only need to filter Done items in the closed Sprints.

Walter Buggenhout _ACA IT_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 08, 2023

Hi @Imba, no worries. That's a matter of playing around with your criteria and parentheses:

project = TIME AND issueType in (Story, Subtask) AND
((sprint in closedSprints() and status = Done) OR
((Sprint in (futureSprints(), openSprints()) OR sprint = EMPTY) AND
Status not in (Done, "Won't Fix")))

Hi @Walter Buggenhout _ACA IT_ , It still loads all the issues

Screenshot 2023-05-09 210519.png

Walter Buggenhout _ACA IT_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 09, 2023

The query I shared should retrieve the following data (in human language):

  • All issues from project TIME that are assigned to a completed sprint AND have status = Done;
  • PLUS all other issues from your project that are not in status Done or Won't fix

That this does return all issues is not entirely strange. If you close a sprint, all unfinished issues are transferred to either the backlog or another sprint. So a completed sprint - by definition - only has completed issues in it (the current query basically only excludes the ones that were marked as Won't fix in that sprint, which is most likely not going to be many).

So could you try to explain - just in plain language - what you are trying to get out of the query?

  • All issues from project TIME that are assigned to open sprints, future sprint and backlogAND not in Won't Fix 
  • No issues from closed sprints
Walter Buggenhout _ACA IT_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 09, 2023

Thx for clarifying @Imba. Try something like this:

Project = TIME AND ((sprint in openSprints(), futureSprints() AND
status != "Won't Fix") OR statusCategory = "To Do")

 Maybe I am over-simplifying things here, but trying to make it easier is often not a bad idea. The statusCategory part returns all statuses with a grey color. I suggest that approach because it should return Open, To Do, Backlog, New, ... without the need to further specify each individual status. If you know what status you use for the backlog, you could replace that part by Status = <that status> too, but that's slightly less dynamic.

You could extend the query to explicitly exclude issues from completed sprints like this:

Project = TIME AND ((sprint in openSprints(), futureSprints() AND
status != "Won't Fix") OR statusCategory = "To Do") AND
sprint not in closedSprints()

But if it does not make a difference in results, you could just as well leave that out.

Hi,

Your query showed error so I have to rewrite it:

Project = TIME AND issueType in (Story, Subtask) AND (sprint in (openSprints(), futureSprints()) AND status != "Won't Fix") OR statusCategory = "To Do"

However, it doesn't show the issues in the backlog.

If I added OR Sprint=Empty, it will show all the closed issues.

Project = TIME AND issueType in (Story, Subtask) AND (sprint in (openSprints(), futureSprints()) AND status != "Won't Fix" OR Sprint=Empty) OR statusCategory = "To Do"

However, it doesn't show the issues in the backlog.

Walter Buggenhout _ACA IT_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2023

Sorry, my bad: I missed a parenthesis in my query. It should have been like this:

Project = TIME AND issueType in (Story, Subtask) AND
((sprint in (openSprints(), futureSprints()) AND
status != "Won't Fix") OR statusCategory = "To Do") AND
sprint not in closedSprints()

When you say the result does not show issues in the backlog, can you explain what status(es0 the issues in your backlog have?

I am getting the feeling that your project is team managed and "the backlog" is a concept you cannot really query for. So it would make sense to query on the status(es) that are used there.

Yes I use team-managed project. The issues in my backlog could have different status: To do, In Progress, etc.

Screenshot 2023-05-10 204835.png

Walter Buggenhout _ACA IT_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2023

Then we should be very close with this one:

Project = TIME AND issueType in (Story, Subtask) AND
((sprint in (openSprints(), futureSprints()) AND
status != "Won't Fix") OR statusCategory != Done) AND
sprint not in closedSprints()

Nothing different. It doesn't show any issue in the backlog (only show issue with a sprint)

Walter Buggenhout _ACA IT_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2023

Okay; radical change. Let's forget about all this sprint stuff, as it seems that is causing the issue.

Project = TIME AND issueType in (Story, Subtask) AND
(status != "Won't Fix" OR statusCategory != Done) AND
sprint not in closedSprints()

Same result, @Walter Buggenhout _ACA IT_ 

Btw, it only shows 1 subtask which is not correct.

Hi @Walter Buggenhout _ACA IT_ . Could you please check?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events