It's all about the answers!

Ask a question

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


Jazzuser user (68849) | asked Jun 22 '17, 1:31 a.m.

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

Accepted answer


permanent link
Shashikant Padur (4.2k27) | answered Jun 22 '17, 11:09 p.m.
JAZZ DEVELOPER

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

Comments
Jazzuser user commented Jun 23 '17, 3:38 a.m.

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


Shashikant Padur commented Jun 25 '17, 11:29 p.m. | edited Jun 25 '17, 11:30 p.m.
JAZZ DEVELOPER
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 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.