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

Get the Component name from Changeset

Hello,

I have a Componetn associated to changeset.

Now I need to get the Component name from the changeset not the .getItemId()

I have managed to fetch the IComponentHandle object.
I have been searching for a way to get the Component name from IComponentHandle. ... Can you help me into that !

    IComponentHandle component = changeSet.getComponent();
    IConfiguration configuration = workspaceConnection.configuration(component);

Thanks in advance,

0 votes


Accepted answer

Permanent link
You should be able to use the IRepositoryItemService to get the IComponent object. From there you can get the name. Hope this helps. 
IRepositoryItemService fRepositoryItemService = getService(IRepositoryItemService.class);
IComponent c = (IComponent)fRepositoryItemService.fetchItem(changeSet.getComponent(), IRepositoryItemService.COMPLETE);
Fatla 777 selected this answer as the correct answer

1 vote

Comments

Thanks Scott :)


One other answer

Permanent link

IProgressMonitor monitor;
ITeamRepository repository;
IComponentHandle componentHandle= changeSet.getComponent();

IComponent component = (IComponent) repository.itemManager().fetchCompleteItem(componentHandle, IItemManager.DEFAULT, monitor);
To get the component:

component.getName()

1 vote

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

Question asked: Feb 25 '13, 10:45 a.m.

Question was seen: 5,459 times

Last updated: Feb 25 '13, 2:06 p.m.

Confirmation Cancel Confirm