Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,802
Community Members
 
Community Events
184
Community Groups

JQL to Retrieve All Projects for Current User

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

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()?

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

Yup, that's it. Darn. 

Thanks for all your guidance. 

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