It's all about the answers!

Ask a question

Latest version of Assets using RAMAssetQueryBuilder


Des Drury (66107) | asked Oct 21 '11, 1:19 a.m.
Hi,

I'm trying to do a search using the RAMAssetQueryBuilder that will only return the latest version of the Assets it finds. The default is to return all versions and this is a very large set. I realize that I can get the latest version of a single Asset if I use the session.getAsset method but this will not work for our usage.

Is there anyway I can construct a RAMAssetQueryBuilder that will return a set of Assets with just the most recent version of each?

Many thanks.

Des Drury

4 answers



permanent link
Sheehan Anderson (1.2k4) | answered Oct 21 '11, 12:31 p.m.
JAZZ DEVELOPER
RAM 7.5.1 will introduce this concept in the web UI, but it's not available from the API yet. This is an enhancement we could open and consider for one of our upcoming service packs.

I have a question about how you would expect the feature to work. Say you have 'Asset A' with versions 1 and 2. You perform a search that matches version 1, but not version 2. Would you expect that
a) Version 1 is returned because it's the latest version that matches your query
b) Version 2 is returned because it's the latest version of the asset even though it does not match your query
c) No results are returned because although version 1 matched your query, it was not the latest version of the asset and version 2 of the asset does not match your query.

In RAM 7.5.1 the web UI works similar to option a.

permanent link
Des Drury (66107) | answered Oct 24 '11, 7:13 p.m.
RAM 7.5.1 will introduce this concept in the web UI, but it's not available from the API yet. This is an enhancement we could open and consider for one of our upcoming service packs.

I have a question about how you would expect the feature to work. Say you have 'Asset A' with versions 1 and 2. You perform a search that matches version 1, but not version 2. Would you expect that
a) Version 1 is returned because it's the latest version that matches your query
b) Version 2 is returned because it's the latest version of the asset even though it does not match your query
c) No results are returned because although version 1 matched your query, it was not the latest version of the asset and version 2 of the asset does not match your query.

In RAM 7.5.1 the web UI works similar to option a.


Hi,

I agree that option a is the best solution. Option b would be confusing as you are not getting what you ask for. Option c would also be confusing as I think what you want is the latest version of an Asset that matches your query, i.e. option a.

As long as the query was quite general, i.e. all Assets of a particular type and name, then you would always get the latest version with option a, which is exactly what we are after.

To be honest I find the fact that all versions are returned by a query to be confusing. As you can always access a previous version of an Asset by going into it and clicking on one of the version links. My expectation of the query is that it should return a set of unique Assets that match the query at their most recent version.

If this behavior could also be implemented in the API that would be great. However, if it is going to be implemented in the GUI then is there some hints you can provide to me about how I might be able to code a similar solution using the current API? I've looked at the Lucene syntax and see no way to implement this functionality using it.

Cheers.

Des

permanent link
Sheehan Anderson (1.2k4) | answered Oct 25 '11, 6:13 p.m.
JAZZ DEVELOPER
Hi

Using the current API, I would suggest sorting the asset results by GUID and then walking through the results, picking out the highest version number for each GUID. Unfortunately this is a manual process until the feature is added to the API.

permanent link
Gili Mendel (1.8k56) | answered Oct 31 '11, 3:03 p.m.
JAZZ DEVELOPER
yep.... note that the term "latest" version is not a black and white one.

e.g., it can be the latest "compatible" version ... e.g., latest fix from Ver.Minor.Fix

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.