I'm trying to create an ordered list of all versions by querying the Jira Server Java API. I'm using
VersionManager.getAllVersions()
to get a Collection of Version objects. Then, for each Version instance in the Collection I call
Version.getSequence()
to obtain the sequence number.
My problem is that this sequence number is the same regardless of how the issues are sorted in the Project configuration page, nor does it seem to make a difference what start or end dates the Versions have.
Is there a way to get a list of all versions in the correct (any?) order?
Hello,
What order do you want? You can always sort the array of versions as you want, after you got the array.
Ideally, I would like them in the same order as they appear in the Project configuration page.
The getSequence() method is undocumented, but I assumed that it would return that order. (It seems as if it returns the order in which the Versions were created.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I guess, you have to use the getSequence() or order by id. I guess it will be the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm still wondering why the getSequence() order is the same as the ID number ordering, though? Do you know what sequence it refers to?
Too bad the method isn't documented! :-/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just had a look at the source code. You need to use the getSequence() to order versions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you!
Do you have any idea why getSequence() returns the same values for me regardless of how I order the versions on the Project settings page?
Could this be a bug?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.