JQL to select current project from JIRA Agile

JIRA Agile has the notion of a "current" project.

For instance, if you select a project from the Projects drop down menu, the left panel shows the currently selected project.

Is it possible to limit a JIRA Agile board to issues in the currently selected project?

What would that JQL look like?

I would think there would be a currentProject() function, along the lines of the existing currentUser function.

We are using JIRA Agile Cloud.

 

3 answers

1 accepted

Accepted Answer
1 vote

Hi Gabriel,

The current project context you see does not carry over to JQL, that is only in the issue search.  There was recently a good discussion about this that you can find at How can I get the current project to use in a JQL query? In addition, here is a link to the Advanced Search knowledge base for JIRA that contains the functions and search patterns that JQL will recognize.

Cheers,

Branden

The idea is to make a board show only issues related to the currently selected project, even when the board's backing query otherwise selects from multiple projects.

This would be useful when a board covers multiple projects but we're only interested in the selected project.

It's really a pity we can't pull this off.

0 votes

No, there's no function, and I'm afraid as a generalisation, it would not work, as the concept of "current project" only applies in some places.

Imagine the JQL as asking the question "what is the current project?".  If I go to a board that has a filter of "project in (A, B, C)" or "issue type = bug", what is the current project?  You can't answer the question.  You can only answer it authoritatively in certain contexts - when you're looking at an issue or a project header really.

Yes, and the place it would make sense is in board queries in Jira Agile, which is exactly where we need it. Statefulness is oddly presented in agile boards already, giving the sense that they are bolted onto the rest of JIRA (they are, obviously).

I get that JQL is a general thing and that the currentProject() function would not make sense in all contexts.

I don't think that's a good reason for such a function not to exist. It could return null in contexts where no current project exists, for instance.

Thanks for your reply.

But that could easily lead you into a situation where two users get totally different boards when they're looking at the same one. 

The context matters here, and the boards can not give you that context.  The function would need to return "null" when used in a board.

Hi @Gabriel Bauman
 If you are using Jira Server you can install the FREE app called JQL Booster Pack throught Atlassian Marketplace and use the requested functionality.

After install this app, you should be able to create a query using recentProjects() function, that will allow you to find issues in your recently viewed projects. You can also limit the number of projects retrieved by this function to get the most recent project.

You can use the following query to retrieve issues of your currentProject.

• Find issues in my current project:

project IN recentProjects(1)



You can find the complete information about this JQL function at its Function Reference page.

Kind regards.

Hi Jack,

Thank you for letting us know about the release of this add-on!  I'll keep in mind for the future.

Cheers,

Branden

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

21,349 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you