Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Finding Project Area from IBaseline using API?

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 :)

0 votes

Comments

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?

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

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

0 votes

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.

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,943
× 7,501
× 1,700

Question asked: Apr 21 '16, 5:04 a.m.

Question was seen: 3,258 times

Last updated: Jun 13 '16, 4:57 a.m.

Confirmation Cancel Confirm