Forums

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

"Environment variables" in JQL statements

Deleted user September 19, 2018

Hi,

I have with the help of posts here created a board filter that includes sub-tickets in my Kanban board. However, when the sub-ticket is added, the issue is moved from its originating swim lane to 'Everything else'.

I get I may have to edit the swim lane rules as well... Sigh. This will be really cumbersome with many sites to administer.

Would it be possible to define anything like 'environment variables', that could then be reused in expressions like JQL?

It would be quite nice to have the configuration in one place and then refer to it in expressions. Much cleaner and less risk of mistakes.

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Steven F Behnke
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.
September 19, 2018

Can you provide an example? I can't understand the goal.

Deleted user September 20, 2018

I cannot post the actual filters, but what I try to say is that I will need to duplicate the same expressions in multiple places, in multiple but similar projects, boards and swimlanes. And if something changes in the environment, I then have to change it in all places these JQL expressions are used. And they are many... This makes Jira feel slightly outdated, but hopefully there is a way to achieve this.

Steven F Behnke
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.
September 20, 2018

If you can't provide an example then I don't know how to help. Since I don't know the specifics, my only answer would be to save parts of a query as a Filter and then include that filter in subsequent queries.

For instance -- 

  • Save a filter with query 'assignee in membersOf("jira-users")' and name it 'Assigned to User'.
  • Create a new query like 'filter = "Assigned to User" AND resolution is EMPTY' and name it 'Unresolved and Assigned to User'.

Does this illustrate my point?

Deleted user September 22, 2018

Hi,

This actually sounds promising. What you are proposing uses the same principal I was looking for. I was unaware I could use a filter in another filter... I will try this out, thanks a lot!

Thanks, Pontus

Steven F Behnke
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.
September 22, 2018

I'm glad that helps. I think the term 'variable' was throwing me off.

As a heads up --

filter in (Filter1, Filter2)

is the same as searching

filter = Filter1 OR filter = Filter2

 

If you need to use AND operator, you must do so explicitly --

filter = Filter1 AND filter = Filter2

 

This 'field' is documented under Advanced Jira searching.

Steven F Behnke
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.
September 22, 2018

Oh! And be sure to fully clear your search in between saving filters. You can easily clear your search by clicking Issues>Search for Issues.

It's very easy to run into a recursive search if you save a filter and then try to use that in your next query without clearing the search. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events