JQL to Retrieve All Projects for Current User

Matt Richards May 16, 2023

I'm working with the JQL below to retrieve issues assigned to current user that are in open sprints and have the "To Do" status across all their projects. The statement below has the current user's two active projects hard coded in ("Product" and "QA"). I am hoping to make this more dynamic so that I can share it across users. 

How can I reference the current user's complete list of projects using JQL to replace these hard coded project names? 

Any help is appreciated!

project IN (Product, QA) AND assignee = currentUser() AND status = "To Do" AND sprint in openSprints() ORDER BY Rank

 

2 answers

1 accepted

2 votes
Answer accepted
Trudy Claspill
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 16, 2023

Hello @Matt Richards 

The search screen is for finding issues, not projects. There is no UI feature to get you an explicit list of only the projects where a user has assigned issues.

If you wanted to reduce the issue search list so that you could see a concise list of the projects rather than each issue then you could do something like use the Two Dimensional Filter Statistics gadget on a Jira Dashboard to organize the issue search results into a table of issue counts across Projects and issue statuses.

Screen Shot 2023-05-16 at 3.13.01 PM.png

Matt Richards May 16, 2023

Thanks for your reply, Trudy. I am not looking for a UI feature. As I mentioned, I am working with JQL. 

Trudy Claspill
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 16, 2023

Perhaps I am not understanding your question.

There is no JQL function for retrieving just a list of projects. JQL is designed for retrieving issues. 

As you discovered, you don't need to have the "project in" criteria in the JQL statement. Omitting it will get all the issues assigned to the currentUser() across all projects.

Are you still looking for a way to get a list of project based on a criteria related to currentUser()?

Matt Richards May 16, 2023

If I cannot use JQL to retrieve a list of projects, then no. 

I do have a question related to that 2d issue gadget you showed. I created one of my own and I'm seeing two "To Do" status columns, one from each of the two projects. 

By chance have you see this before, or might you have an idea as to why it happened? We have not customized our statuses at all. The projects are basically bare bones. 

Thanks for your thoughts and responsiveness. 

2dissues.png

Trudy Claspill
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 16, 2023

Are you using Team Managed projects in your instance? If so, the Statuses in the workflows are each considered a unique Status value with a unique numeric ID in the database, even if the human readable name of the Status is identical to a Status in another project's workflow

Matt Richards May 17, 2023

Yup, that's it. Darn. 

Thanks for all your guidance. 

0 votes
Matt Richards May 16, 2023

Having written this I realize now that if I am explicitly looking for ALL projects I could probably just remove this:

project IN (Product, Matt) AND

To yield:

assignee = currentUser() AND status = "To Do" AND sprint in openSprints() ORDER BY Rank

So... that works, but it would still be useful to know if it is possible to retrieve the complete list of projects for a user.

Suggest an answer

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

Atlassian Community Events