On delivery of changeset, how to retrieve component list under a stream via changeset?
![]()
Sudaraazhi Arivalagan (44●18●29)
| asked Jul 15 '15, 1:35 a.m.
edited Jul 15 '15, 3:03 a.m. by Ralph Schoon (63.3k●3●36●46) Hi Ralph, Kindly help on how to retrieve list of components under a specific stream from a ChangeSet..[on server side] Thanks in advance. |
Accepted answer
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Jul 15 '15, 3:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jul 15 '15, 3:54 a.m.
Mind your tagging, this is likely "extending" and not administration.
In an SCM delivery advisor like https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/ The following approaches can be done, as far as I can tell from looking at com.ibm.team.filesystem.service.internal.process.StreamComponentsPermissionAdvisor.class - the class that I found by looking at references of the extension point in said advisor. Get the components from the destination stream - all components referenced by the stream Object operationData = operation.getOperationData(); if (!(operationData instanceof DeliverOperationData)) { return; } DeliverOperationData data = (DeliverOperationData) operationData; IWorkspace destination = data.getDestWorkspace(); IScmService scmService = this.getScmService(); IComponentHandle[] componentHandles = scmService .getComponentsForWorkspace(destination, null); IComponent[] components = (IComponent[]) this .getRepositoryItemServiceForScm().fetchItems(componentHandles, IRepositoryItemService.COMPLETE); Get the components from the delivered change sets - not all, but only the ones we deliver to Object operationData = operation.getOperationData(); if (!(operationData instanceof DeliverOperationData)) { return; } DeliverOperationData data = (DeliverOperationData) operationData; List Sudaraazhi Arivalagan selected this answer as the correct answer
Comments Hi Ralph, I was wondering how to get this from last two days. Grateful to you !! for a favor I am sure caring about Tagging from next time. Thanks again. Please keep in mind that I did not test the code, there might be things to check.
Ok Sure. Thanks. |
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.