How do you obtain list of change sets being delivered in a Baseline in a Deliver Operation Advisor
![]()
I am working on a Deliver operation advisor to verify change set / work item linkages. When change sets are delivered by themselves, the DeliverOperationData for the deliver operation provides the list of change sets. When a baseline is delivered along with some new change sets (as part of the baseline) the DeliverOperationData does not provide the new change sets that are being delivered. I can get the handle(s) to the baseline(s) being delivered, but I am not seeing a straightforward way to obtain the change sets. Do I have to compare the baseline against the destination workspace/stream or is there a more direct way of identifying the new change sets? Does anyone have any example code of how to go from deliverOperationData.getBaselines() to a list of IChangeSetHandles (like is returned from deliverOperationData.getChangeSetHandles()?
Thank you, Jamie Berry. |
One answer
![]()
You can use the source and destination workspaces and compare them with each other.
IWorkspaceConnection connection = SCMPlatform.getWorkspaceManager(ITeamRepository).getWorkspaceConnection(DeliverOperationData.getSourceWorkspace(), monitor);
You can follow that snippet to get your comparison report. That will return the baselines including change sets that differ from the two workspaces.
Comments Thanks for your reply. I am doing this as part of a Deliver operation advisor, so I can't compare the two workspaces as not everything may be delivered. I have been looking at comparing the baseline that is being delivered to the destination workspace, I just have to figure out how to get the WorkspaceManager from the advisor as I don't have all the same objects as when just writing a stand-alone plain java api based client. Thanks again.
Oh right, the advisor is being run on the server. You should obtain IScmService to compare your baseline and workspace. ![]() FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Jamie found https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/ which should solve that part.
Thanks everyone. I have my advisor working as desired (for the most part) now. I wound up using:
You can do something like this to get a repository monitor:
IRepositoryProgressMonitor repositoryMonitor = IRepositoryProgressMonitor.ITEM_FACTORY
.createItem(IProgressMonitor);
|