How can I query multiple branches with earliestUnreleasedVersion()?

Gy September 29, 2017

Hi All,

In a single project we are using multiple branches like, 1.0, 1.1, 1.2 AND 2.0, 2.1, 2.2...

I'd like to write a dynamic query for the earliest unreleased version for which there is the earliestUnreleasedVersion() function. But is it possible to somehow add a condition to the result of this function? E.g. earliestUnreleasedVersion() AND versionmatch 1.* So I'd be able to differentiate the two branches. This function is currently handling all versions as one branch and give me only 1 result. Is it possible to somehow add a condition to this?

 

Thanks in advance!

1 answer

0 votes
Jobin Kuruvilla [Adaptavist]
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 29, 2017

When you say branches, I assume you are talking about JIRA versions.

Searching based on a regex is not an out of the box functionality in JIRA. You can do this with the help of a plugin like JQL Tricks. It has a versionMatches function that can be used for this purpose.

Gy October 2, 2017

Hi,

Thanks for the quick answer. Unfortunately, in my case branches means different versions of our software. Let me write an example!

I have only one project e.g.: MySoftware

In this project I have the following fixVersions: 1.0, 1.1, 1.2, 2.0, 2.1, 2.2 (two branches - 1.x and 2.x)

Let's say 1.0 and 1.1 are released 1.2 is not released on the 1.x branch while 2.0 is released,  2.1 and 2.2 is not released on the 2.x branch.

I'd like to write a dynamic query that shows the earliest unreleased version for the 2 branches separately.

If I try with:

project=MySoftware AND fixVersion = earliestUnreleasedVersion(MySoftware)

The result will be either 1.2 or 2.1 or 2.2 (depending on the dates, set for the versions)

So I've added an extra condition to separate the different branches

project=MySoftware AND fixVersion = earliestUnreleasedVersion(MySoftware) AND fixVersion in versionMatch('1.')

project=MySoftware AND fixVersion = earliestUnreleasedVersion(MySoftware) AND fixVersion in versionMatch('2.')

What I'm expecting is to get 1.2 in the first case and 2.1 in the second case, but one of this queries will have no matching result, as there can be only one earliest unreleased version within a single project which is either 1.x or 2.x. (For Jira it doesn't matter if the versions are representing 2 separate branches there can be only 1 earliest unreleased in a project.) I know I could use 2 projects for the 2 branches but unfortunately this can not be changed.

I know it's a bit complex but I tried my best to explain. I hope I was clear now.

BR,

Gy.

Suggest an answer

Log in or Sign up to answer