dbosman wrote:But as said this traverses the complete history. Is there a way to get the latest revision more directly? eg.

Maybe not more direct but probably faster concerning runtime.

You can get all Revision ids as a String array of a workitem with the getRevisions() method, which requires the URI of a work item, Testrun, Plan or any type of object in Polarion (as long as it has a URI) as a parameter. In this String array, the last cell contains the id of the last revision, so you can access it directly like that:

// Note: revisionIDs ist just an example name of that arrayString lastRevisionID = revisionIDs[revisionIDs.length -1];

This id can then be used for the getRevision() method, which returns a Revision object and requires the repository name and the id of a revison as parameter. As repo name you can use "default". This revision object contains all the information you probably need (the work items that were included, the commit date and so on).

NOTE: You could also use the getRevisionByUri() method if you like, as you can create the URI with a little bit of String building. A revision URI looks like this, the numbers after the last curly bracket represent the revision id: