order by doesnt really work well

jelle van den broek
Contributor
September 29, 2022

Okay so I have a list of versions I want sorted by date. I'm doing an internship at a company where they give the versions names like 7.3.7. First I did sort by release date, but that didn't work because several versions were released per day and then it grabs the version with the first digit in the list. for example you have 7.3.7 and 7.3.17. 7.3.17 was released later than 7.3.7, but he sees the 17 in 7.3.17 in the name earlier than 7.3.7. and sorting by name doesn't work either. so hopefully someone can help me with this. thanks in advance.

1 answer

0 votes
__ Jimi Wikman
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, 2022

It seems that you are not doing versions correctly if 7.3.17 should come after 7.3.7

The correct way to do version numbering is to build upon the latest version in the following formula: major.minor[.build[.revision]]

So in your case 7 is the major release, 3 is the minor and 17 and 7 are the build numbers. The way this numering works you should always start with a 0 for single digit builds when they are expected to go above 10 builds.

The means that for your sequence to make sense, your 7.3.7 should actually have been 7.3.07. Currently, it reads as 7.3.70 as it will add another 0 when comparing to a two-digit number as you have in 7.3.14.

So to get your numbering right you might want to reconsider your numbering strategy to either always start with one or two zeros, or you will use the revision field as well so you get the right granularity.

I hope that helps.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events