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
Jamie Berry
commented Oct 23 '14, 10:42 a.m.
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.
Ralph Schoon
commented Oct 23 '14, 11:14 a.m.
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.
Jamie Berry
commented Oct 23 '14, 12:59 p.m.
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);
|
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.