It's all about the answers!

Ask a question

Finding Project Area from IBaseline using API?


vijayakumar ramesh (105443) | asked Apr 21 '16, 5:04 a.m.
I want to know is it possible to get the project area handle starting with Ibaseline object .
If some body has refernce code would be helpful or pointing to use particular API's would be great :)

Comments
Geoffrey Clemm commented Jun 12 '16, 5:59 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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 commented 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 commented 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

Accepted answer


permanent link
Ralph Schoon (54.9k23642) | answered Apr 21 '16, 5:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 21 '16, 5:49 a.m.
I am not aware that a baseline would be related to anything other than the component. So there is no natural relationship to a project area. Actually there might be none at all, as SCM data is managed orthogonal to other CCM data. SCM data can be read and written in multiple project areas. 

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.
David Lafreniere selected this answer as the correct answer

Comments
vijayakumar ramesh commented Apr 21 '16, 7:02 a.m.

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?


Ralph Schoon commented Apr 21 '16, 8:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.

Your answer


Register or to post your answer.