JQL to select current project from JIRA Agile

Gabriel Bauman June 13, 2017

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

1 vote
Answer accepted
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 13, 2017

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

Gabriel Bauman June 13, 2017

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.

Like jelmerjellema likes this
0 votes
Jack Nolddor _Sweet Bananas_ December 12, 2017

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.

somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 12, 2017

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

Jack Nolddor _Sweet Bananas_ December 12, 2017

You're welcome ;)

David Babuder October 25, 2019

Its great that there is an add-on.

Unclear why the originators of the tool could not be convinced of the need for the function.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 13, 2017

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.

Gabriel Bauman June 13, 2017

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.

Like jelmerjellema likes this
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 13, 2017

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.

Suggest an answer

Log in or Sign up to answer