Forums

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

Search for fixVersion/affectedVersion using ranges

Roman Wolf
Contributor
September 7, 2021

Hi community,

we are using releases in JIRA to plan our sprints and assign issues accordingly.

 

Problem

I want to filter out what issues where raised/fixed before or after a certain version.

 

Circumstances

Our version schema is something like:

  • <product-name>_<version-number> OR
  • <product-name>_<version-number>_<additional-information>

where underscore (_) represents a space.

<product-name> is a string of letters

<version-number> is of format 1.2.3.4 (semantic versioning with 4 numeric digits)

<additional-information> is a string of letters

 

Approach

I tried JQL and specified the range with "<", "<=", ">" or ">=" like:

project = xxxx AND type = Bug AND resolution in (Fixed, Unresolved) AND affectedVersion <= "<product> <version>" AND fixVersion > "<product> <version>" ORDER BY affectedVersion DESC, fixVersion ASC, priority, component DESC

Unfortunately when I looked into the results version are included which should be skipped.

I assumed JIRA is treating the release version as String and therefore apply some kind of String comparison. But this does comply with the results I get. So something else must happened while executing the JQL on the database.

 

Current Workaround

As a workaround I am currently using "in (...)" and "not in (...)" specifying each and every version directly.

This has the big disadvantage that with every new version created in the JIRA project later on I have to adapt all queries of that type which should be avoidable work.

 

Question

How to achieve that I provide only 1 version string and the JQL query returns me the before/after results?

Do we need to change our version scheme? Is there any other operator in JQL to work with a single version string?

 

Thank, Roman

 

Answer

Regardless of how the version description looks like SORTING is driven by the arrangement of the versions under Project > Releases.

Open the Releases page and sort all your versions there. Make unreleased and released versions visible and sort the top to bottom which means newest to oldest.

The range in your JQL will be applied according to this order.

Here on our project versions are created any time (newer once, intermediate once and etc.). So the order is chaotic after that. The project lead just has to apply the correct order ét voilá it works out as expected.

1 answer

0 votes
AndreasS
Contributor
January 20, 2014

Here is the corresponding bug report: https://tngtech-oss.atlassian.net/browse/JBCP-5

Suggest an answer

Log in or Sign up to answer