Finding Project Area from IBaseline using API?
Accepted answer
So which project area handle do you want to get? The baseline is for a component. A component has an owner which could (but does not necessarily have to) be a project area or nested in said project area. A component has visibility which might or might not be based on a project area. A component is used in a stream which have some relationship to a project area. The component might be used in other streams with other relationships to other project areas.
A component can be privately owned in which case there would be no project area relationship at all.
Comments
But In production normally components are owned by either Team or Project Area. Which in turn will be used in streams. We can drop scenario of private components. My use case is to find the Project area from Baseline of component.
Component could be owned by Project area or Team area.
A component can be owned by one PA at time, so it belongs to one Project area. Not to multiple PA's at time.
Though Baselines of component can be used in different PA's, ownership of component belong to one PA.
I want to find this Projetc area Handle from Ibaseline object of Baseline.
Is it possible to achieve this?
Pretty sure as I explained above.
IBaseline baseline = (IBaseline) getTeamRepository().itemManager().fetchCompleteItem(baselineHandle,
IItemManager.REFRESH, monitor);
IComponentHandle componentHandle = baseline.getComponent();
com.ibm.team.scm.common.IScmService.getComponentOwnerRecord(componentHandle)
and go from there.
See https://rsjazz.wordpress.com/2016/01/27/manage-access-control-permissions-for-work-items-and-versionables/ and the other posts for how to get the SCM Service.
Comments
Geoffrey Clemm
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jun 12 '16, 5:59 p.m.Just for interest's sake, why do you want to obtain the project area that owns the component containing that baseline? I.e. what are you going to do with it, once you obtain it?
vijayakumar ramesh
Jun 13 '16, 4:56 a.m.We want to implement linkage between Baseline and Work item so that user when right click on baseline will be able to link it to the Delivery work item.problem is Snapshot is able to give me owner but For baseline I am still not found solution,Please let me know any API available for this or Not
vijayakumar ramesh
Jun 13 '16, 4:57 a.m.This is the below code which gets PA handle from snapshot
private IProjectAreaHandle getProjectAreaOfSnapshot(final IBaselineSet snapshot) throws TeamRepositoryException {
final IWorkspaceHandle workspaceHandle = snapshot.getOwner(); //I don’t find this function for baseline