Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

JavaPlainApi get workItem references from workItemCopy is always null

I'm developing a RTC Client with the Java Plain API 4.0.1. The client gets a WorkItem by Id and then it uses a WorkItemOperation for getting the current references and performing some modifications but the workitem references are always null although I can see the WI has links to other WIs on the web browser. ¿What else is needed for getting de references?

private static class WorkItemReferencesModification extends WorkItemOperation {

private IWorkItemHandle fOpposite;

public WorkItemReferencesModification() {
    super("Modifying Work Item References",IWorkItem.FULL_PROFILE);
}

@Override
protected void execute(WorkItemWorkingCopy workingCopy, IProgressMonitor monitor) throws TeamRepositoryException {
    IEndPointDescriptor endpoint = ILinkTypeRegistry.INSTANCE.getLinkType(WorkItemLinkTypes2.CUSTOM_LINK).getTargetEndPointDescriptor();
    workingCopy.getReferences().getReferences(endpoint); // THIS IS ALWAYS NULL!!!
}&nbsp;</pre>

0 votes



2 answers

Permanent link

I have published how that worked for me here
https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/
and here
https://rsjazz.wordpress.com/2012/10/20/following-calm-links-using-the-java-client-or-server-api/

0 votes


Permanent link

Hi Ralph, actually I read both articles and on other RTC 5.0.2 I have a client where this works right. But on this RTC 4.0.1 references come empty. I used your method analyzeReferences(IWorkItemReferences references) but on List endpoints = references.getTypes(); does not return any type.

In addition I tried force resolving references from WorkItem getting from WorkItemCopy with:


IWorkItemCommon common= (IWorkItemCommon) ((ITeamRepository)workItem.getOrigin()).getClientLibrary(IWorkItemCommon.class);
IWorkItemReferences references = common.resolveWorkItemReferences(workItem, null);
    
Maybe if I use IQueryResult the references could come resolved.

0 votes

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

Question asked: Oct 18 '17, 8:48 a.m.

Question was seen: 2,972 times

Last updated: Oct 18 '17, 10:09 a.m.

Confirmation Cancel Confirm