How to change the ownership of a component ?
I have found one code snippet from somewhere but it is not working for me. Can you please help me on this
IScmService scmService = null;
IRepositoryItemService itemService;
IComponentHandle componentH;
ComponentOwnerHandle componentOwnerH = scmService.getComponentOwnerRecord((ComponentHandle) componentH);
ComponentOwner componentOwner = (ComponentOwner) itemService.fetchItem(componentOwnerH, IRepositoryRemoteService.COMPLETE);
IAuditableHandle ownerH = componentOwner.getOwner();
if (componentHandle == null) {
// Rename component
componentHandle = wm.createComponent(componentName,
teamRepository.loggedInContributor(), monitor);
wm.setComponentOwner(componentHandle, ownerH, monitor);
} else {
// Rename component
wm.renameComponent(componentHandle, componentName, monitor);
wm.setComponentOwner(componentHandle, ownerH, monitor);
}
|
One answer
Ralph Schoon (63.7k●3●36●48)
| answered Jun 12 '18, 4:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Comments IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(teamRepository); wm.setComponentOwner(componentHandle, newOwnerHandle , monitor); newOwnerHandle the new owner; must be either a IContributorHandle or a IProcessAreaHandle; must not be null (IProcessAreaHandle = ProjectAreaHandle or TeamAreaHandle) |
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.