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

How to programmatically get the latest snapshot details for a given Stream in RTC SCM.

Hello All,

I have a usecase wherein, I need to programmatically get the latest snapshot details of the given stream as input.

Are there any APIs to get the latest snapshot details ?

Thanks

0 votes


Accepted answer

Permanent link

IWorkspaceManager#findBaselineSets(...) will return List<IBaselineSet> and you should be able to retrieve all the information with respect to the snapshot from IBaselineSet.

David Lafreniere selected this answer as the correct answer

0 votes

Comments

Thanks for your reply Shashikant. I tried with findBaselineSets(...) but  I am unable to get the latest snapshot.....could you please share any sample snippet.

Thanks

IBaselineSetSearchCriteria criteria = 
IBaselineSetSearchCriteria.FACTORY.newInstance();
criteria.setOwnerWorkspaceOptional(stream); // stream (IWorkspace) which owns the snapshot. Make sure that the snapshot is owned by the tream. You can verify this by the listing the snapshots of that stream using the RTC client.
If you know which project/team area (IProcessArea) owns the stream:
criteria.setProcessArea(processArea)
List<IBaselineSetHandle> baselineSetHandles = SCMPlatform.getWorkspaceManager(repo).findBaselineSets(criteria, 1, progressMonitor);
List<IBaselineSet> baselineSets = repo.itemManager().fetchCompleteItem(baselineSetHandles.get(0), IItemManager.DEFAULT, progressMonitor);
<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} span.s1 {color: #7e504f} span.s2 {color: #0326cc} span.s3 {color: #931a68} </style>

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,935
× 1,202
× 79
× 74

Question asked: Jun 22 '17, 1:31 a.m.

Question was seen: 2,965 times

Last updated: Jun 25 '17, 11:30 p.m.

Confirmation Cancel Confirm