Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL to list all tasks under userstories part of the current sprint

Gerrit Deloose
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 24, 2025

Dear,
spent already quite some time scrolling through post but couldn't find perfect match. 

I want to build  JQL which gives me all the tasks under US which are part of the current sprint 

 

'problem' is that tasks re not directly part of a sprint but only userstories are so I'm  bit struggling to get that relationship in my query 

project = XXX and issuetype = task and issue in linkedissuesof (Sprint = 65483 )

gives an exception.

 

any suggestions? (or link to a  proper youtube training on writing JQL?)

 

kind regards,

2 answers

1 accepted

0 votes
Answer accepted
Thorsten Letschert _Decadis AG_
Community Champion
July 25, 2025

Hey @Gerrit Deloose

The default linkedIssues() function does not support subqueries and can only be used with dedicated (single) issue keys.

What you're trying to achieve could be done using an additional app.

Jira Workflow Toolbox, for example, comes with dedicated JQL functions, and a query for your use case might read

project = XXX and issuetype = task and issue in linkedTo("sprint = 123")

using the linkTo() function.

Another app capable of doing this is ScriptRunner, which has a linkedIssuesOf function.

Regards from Germany,
Thorsten

Disclaimer: I'm part of the team behind the first app mentioned.

0 votes
Trudy Claspill
Community Champion
July 25, 2025

Hello @Gerrit Deloose 

Welcome to the Atlassian community.

I have a few questions about your statement:

I want to build  JQL which gives me all the tasks under US which are part of the current sprint 

Can you show us a "US" show the "tasks" that are "under" it? I want to make sure I correctly understand the issue type hierarchy you are using.

To find issues that are in a sprint use the syntax:

sprint = <sprint ID>

Refer to the Sprint field documented here in Advanced JQL Searching:

https://confluence.atlassian.com/jirasoftwareserver/advanced-searching-fields-reference-939938743.html

 

If you use a query like this:

project = XXX and issuetype = task and sprint = 123

...then you will get all Task type issues from project XXX that are in the sprint with ID = 123.

 

Gerrit Deloose
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 28, 2025

Hi Trudy, 

I've linked tasks to US  using 'is action plan of' linktype.
when I run your query I only get 1 out of the 44 tasks. seems like the field sprint is only available/created/copied down (?) for this on task. On the other tasks the field 'sprint' is empty (so it makes sense they are not appearing in the resultset.
 

Should I create an automation to fill in the field 'sprint' on task level upon starting the sprint?

 

Gerrit

Trudy Claspill
Community Champion
July 28, 2025

Hello @Gerrit Deloose 

You have indicated that you are using generic linking to create the relationship between the US and the tasks. The native Jira functionality does not infer any sort of parent/child relationship between items linked in this manner nor does it automatically copy of synch data between items linked in this manner.

Let us re-examine your requirement:

I want to build  JQL which gives me all the tasks under US which are part of the current sprint

Which issues are you assigning to the sprint; the US or the tasks?

If the US is assigned to the sprint but the tasks are not, then you are correct that the query I provided will not retrieve the tasks.

Are the US and the tasks in the same project?

Is it your intention that all the tasks linked to a US be in the same sprint as the US?

Are tasks ever linked to more than one US?

Is there a specific reason you chose to use US and tasks and linking rather than using subtasks, or Epics and child items?

Suggest an answer

Log in or Sign up to answer