You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
I'm looking for a queries that can return the user stories on my backlog that are DONE with some criteria, and on whom time have been spend (either on the user story itself, or one of it subtask)
I have a query that works fine, as long as I don't have to look for timespent on subtasks :
project in ("<MyProject>")
AND status in (Closed, Done, Built)
AND "Story Points" > 0
AND labels = label1
AND labels = label2
AND timespent > 0
But devs in my team also log time on subtasks, and sometimes not the user story itself.
I tried this :
project in ("<MyProject>")
AND status in (Closed, Done, Built)
AND "Story Points" > 0
AND labels = label1
AND labels = label2
AND ( timespent > 0 OR issueFunction in subtasksOf("timespent > 0"))
No JQL errors, but didn't work. I can't find any issue. Do you have an idea ?
Thank you very much
I think this will work
project in ("<MyProject>")
AND status in (Closed, Done, Built)
AND "Story Points" > 0
AND labels = label1
AND labels = label2
AND issuetype not in sutaskIssueTypes()
AND (
timespent > 0 OR (
issueFunction in subtasksOf("project in ("<MyProject>")
AND status in (Closed, Done, Built)
AND "Story Points" > 0
AND labels = label1
AND labels = label2"
AND timespent > 0))
)
)
Breaking it down, the first part will get all the non-subtasks that have story points and non-zero timespent:
project in ("<MyProject>")
AND status in (Closed, Done, Built)
AND "Story Points" > 0
AND labels = label1
AND labels = label2
AND issuetype not in subtaskIssueTypes()
AND (
timespent > 0
The second part takes the non-subtask issues retrieved in the first part and selects just the ones that have non-zero timespent
AND (
timespent > 0
So, at that point you have all the non-subtask issues with non-zero time spent.
The third part uses the first part (all non-subtask issues, whether they have timespent or not) and gets the subtasks of those issues, but just the subtasks that have non-zero timespent.
OR (
issueFunction in subtasksOf("project in ("<MyProject>")
AND status in (Closed, Done, Built)
AND "Story Points" > 0
AND labels = label1
AND labels = label2"
AND timespent > 0))
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.