Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Is there a API to get the name of only latest snapshot from the stream?

 The use case is I have IWorkspaceConnection object and I need to fetch the name of the latest snapshot. There is a api ".getBaselineSets(IProgressMonitor)" , however it lists all the snapshot and the javadocs says "The items in the list not specified to be in any particular order" . Is the first object in the list is the latest one or Is there any other api's to fetch the latest snapshot details?

0 votes



One answer

Permanent link

As far as I know, to fetch the latest snapshot you have to retrieve the creation dates and compare them. 

Pehaps this code snippet I used some time ago for this purpose can help you:

List<?> snapshots = reportStreamConn.getBaselineSets(monitor);
for (Object snapshotObj : snapshots) {
  IBaselineSetHandle snapshotHandle = (IBaselineSetHandle) snapshotObj;   
  IBaselineSet snapshot = (IBaselineSet) repo.itemManager().fetchCompleteItem(snapshotHandle,   IItemManager.DEFAULT, monitor);
  Date snapshotCreationDate = snapshot.getCreationDate();
// compare the dates and retrieve the most recent
// .....
}

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,954
× 74

Question asked: Aug 04 '21, 3:47 a.m.

Question was seen: 1,273 times

Last updated: Aug 05 '21, 10:30 a.m.

Confirmation Cancel Confirm