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

Error while displaying linktypes

Hello team

I am trying to get the list of all the linktypes using below code :
URI urilink = URI.create((GlobalConstants.getPROJECT_AREA()).replaceAll(
                " ", "%20"));
       
       
       
        Location location = Location.location(urilink);
    IReference itemHandles = IReferenceFactory.INSTANCE.createReferenceFromURI(location.toAbsoluteUri());
   
        final ILinkManager linkManager =(ILinkManager) teamRepository.getClientLibrary(ILinkManager.class);
       
       
                ILinkQueryPage queryPage = linkManager.findLinks(itemHandles, monitor);
               
                 ILinkCollection links = queryPage.getLinks();
                        for (ILink l : links) {
                IItemHandle linkHandle = (IItemHandle) l.getTargetRef().resolve();
                ILink link = (ILink)teamRepository.itemManager().fetchCompleteItem(linkHandle, IItemManager.DEFAULT, null);
                String linktype = link.getLinkTypeId();
               
                        }

but i get the following error :

Exception in thread "main" java.lang.IllegalStateException: Location was not constructed with absolute location information
    at com.ibm.team.repository.common.Location.toAbsoluteUri(Location.java:1222)
    at com.ccps.bosch.autoiteration.main.AutoIteration.main(AutoIteration.java:136)

anybody has any idea regarding this error???



0 votes



2 answers

Permanent link

Yes, you make false assumptions about how link types work. Not all are location based. To help beginners I created https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/ and a tom of other posts. I would suggest you search that blog first if you want examples. 


0 votes

Comments

Hi Ralph

i was trying to get the flat list of linktypes in RTC ,I was unabbe to find client  libraries for the same ..

if i see the blogs ,all libraries are related to workitems where we get the linktypes  .
Is there any way where we get the flat list of LinkTypes  using Project area ?

Thank You

I don't know if there is a method to get all link types. That is not the question I tried to answer here. 


If you want that question answered, I would try com.ibm.team.links.common.registry.ILinkTypeRegistry.allEntries()

1 vote


Permanent link

Hello Ralph

Thank you for the reply

I tried to hit  com.ibm.team.links.common.registry.ILinkTypeRegistry.allEntries()  but i get the below information :

[LinkTypeEntry for com.ibm.team.workitem.linktype.qm.relatedTestSuite:, source: com.ibm.team.links.common.internal.registry.EndPointDescriptor@2f80cb79, target: com.ibm.team.links.common.internal.registry.EndPointDescriptor@4816ee24,

Is it able to get the id and name of the Linktypes using this ?

eg : com.ibm.team.workitem.linktype.tracksworkitem.tracks -->Tracks

com.ibm.team.workitem.linktype.resolvesworkitem.resolvedBy---> Resolved By

Thank you in advance

0 votes

Comments

 I don't know. I have never tried anything like that. Keep in mind that there is also localization involved. I Defined the display names I wanted on my own. You would have to look into the RTC Eclipse client UI if you want to find that out.

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

Question asked: Feb 08 '17, 4:24 a.m.

Question was seen: 2,132 times

Last updated: Feb 08 '17, 8:24 a.m.

Confirmation Cancel Confirm