Filter help - subtasksOf(<CURRENT JQL>)

Ryan February 18, 2019

I'm wondering if it is possible to use the subtasksOf function dynamically, rather than hard coding the subquery. Here's my example:

assignee = <PERSON>

This shows the following:

  1. Subtasks that I am assigned to

  2. Stories that I am assigned to

On my team's board, we have a filter like the above for every person on our team. I was toying with the following change:

assignee = <PERSON> OR issueFunction in subtasksOf("assignee = <PERSON>")

This shows the following:

  1. Subtasks that I am assigned to

  2. Stories that I am assigned to

  3. All subtasks for stories that I am assigned to, even if they are unassigned or assigned to someone else

Number 3 above is the new functionality. However, rather than having this be the default behavior for every Person's Name filter, I was wondering if I could kick that out into its own filter, a la "Show All Subtasks", so that this behavior would be toggle-able.

Is there any way to reference the currently filtered / displayed issues in the Subquery parameter?

1 answer

0 votes
Maksim Smetannikov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 18, 2019

Hi Ryan,

I'm not sure that I understood you correctly) maybe:

assignee = currentUser() OR issueFunction in subtasksOf("assignee = currentUser()")

 Is there any way to reference the currently filtered / displayed issues in the Subquery parameter?

Yes - to do this, you need to save the filter with filtered issues and refer to its name. Example: 

issuefunction in subtasksOf("filter = 'Stories in Epic'")

More: https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_more_complex_examples

Suggest an answer

Log in or Sign up to answer