It's all about the answers!

Ask a question

How to check if the particular changeset is part of a given snapshot in RTC SCM programatically.

Jazzuser user (681050) | asked Jul 11 '18, 6:57 a.m.
edited Jul 11 '18, 10:09 a.m. by David Lafreniere (4.8k7)

Hello All,

I have a usecase wherein i need to search for a CS.
I have a Snapshot URI and a CS UUID, Is there any way that i can locate/find this CS ?

Are there any APIs to do this ?

Request you to assist on this. Thankyou.

Accepted answer

permanent link
David Lafreniere (4.8k7) | answered Jul 11 '18, 10:08 a.m.
If you are writing client-side code, the API to use is in IWorkspaceManager:
   List<ILocateChangeSetsSearchResult> locateChangeSets(ILocateChangeSetsSearchCriteria scope, IProgressMonitor monitor)

If you are writing server-side code, the API to use is in IScmQueryService:
   ILocateChangeSetsSearchResult[] findLocateChangeSets(ILocateChangeSetsSearchCriteria scope, IRepositoryProgressMonitorHandle repoMonitor)

You pass in the IChangeSetHandle and the IBaselineSetHandle (snapshot) to the ILocateChangeSetsSearchCriteria.

If the change set exists in the snapshot, then ILocateChangeSetsSearchResult.getSnapshots() will contain the snapshot passed in (otherwise the list will be empty)

Jazzuser user selected this answer as the correct answer

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.