Forums

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

Can we do a JQL search leveraging the results of a second search?

Marie-Emmanuelle Flute
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!
October 10, 2021

Hello,

I have a project, Project 1, where reporters specify who is their manager in the task they create. "Manager" is one of the fields under "People".

I'm looking to build a Dashboard where a Manager will be able to see the tasks for a second project, Project 2, that are assigned to their reports.

 

I was thinking about using the gadget "Filter Results Gadget" and a 2-fold search:

Search 1. Select reporters where project = "Board 1" and Manager = currentUser() and 

Search 2. Select tasks where project = "Board 2" AND assignee IN {search 1's results}

 

I don't think it's possible to do it using JQL as, from what I could find, a JQL search is only listing tasks, and it doesn't seem that it can search within the results of another query.

Would you be able to confirm?

Would you have any idea on how to achieve this search by any chance? 

 

Thank you very much in advance for your help! :) 

1 answer

1 accepted

0 votes
Answer accepted
Ivan Lima
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.
October 10, 2021

Hi @Marie-Emmanuelle Flute. Welcome to Atlassian Community!

Yes, you can use a filter as a field in JQL. However, you wouldn't search within results but combining your JQL by narrowing your search with an existing saved filter.

In a nutshell, JQL allows you to search for specific issues matching several criteria. JQL consists of fields, operators, keywords, and a value or function. Therefore, you won't have a structure like traditional SQL "select/from/where", for example.

For your search 1, you'll find issues from your project Project1, where managers are the current user.

project = "Project1" and Manager = currentUser()

For your search 2, the field assignee is a USER field type, meaning that you can find issues assigned to particular users. There are supported operators and functions you can use, and another filter is not one of them.

In this case, building a dashboard sounds like a good approach, especially if you want to present a statistic of issues in a project where the assignees are also assigned to issues in other projects—adding the two-dimensional filter statistics gadget, for example.

(project = "Project1" AND Manager = currentUser() OR project = "Project2")

Have a look at Advanced searching to get some additional insights into how you can build your JQLs. Lastly, you can use apps to extend the out-of-the-box JQL capabilities where you can have more complex searches.

I hope that all make sense.

Marie-Emmanuelle Flute
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!
October 11, 2021

Thanks a lot for your reply @Ivan Lima, I appreciate your quick feedback! 

Like Ivan Lima likes this
Ivan Lima
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.
October 13, 2021

No problem. If this answer helped you, it would be great to mark it accepted to help other users find it ;)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events