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

How to get Affected By Defect in Java API

 Hello Team,

I am trying to get the list of Affected By Defect logs using Java API, Though there is no direct parameter for Affected By Defect in WorkItemEndPoints
I am using the following code, but isItemReference() is not returning true


for(IReference ir: ((ISaveParameter) data).getNewReferences().getReferences(ILinkTypeRegistry.INSTANCE.getLinkType(WorkItemLinkTypes.AFFECTED_BY_DEFECT).getTargetEndPointDescriptor()))
{
if(ir.isItemReference())
{
IWorkItem r;
try {
r = iac.resolveAuditable((IWorkItemHandle)ir.resolve(),IWorkItem.FULL_PROFILE, null);
WorkflowInfo y =wfm.getWorkflowInfo(r, monitor);
String targetWItype = r.getWorkItemType();
String targetStateName = y.getStateName(r.getState2());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
How can i fetch the logs details, Thanks for help!!

1

1 vote

Comments

 Hello Pankaj

My requirement is same as your.
Any luck on this?
Thanks in Advance!


Accepted answer

Permanent link
Because it is not a WorkItem to Work Item Link and it is likely not an ItemReference either.

The link type should be com.ibm.team.workitem.common.model.WorkItemLinkTypes.AFFECTED_BY_DEFECT
and the endpoint should be ILinkTypeRegistry.INSTANCE.getLinkType(
                            WorkItemLinkTypes.AFFECTED_BY_DEFECT)
                            .getTargetEndPointDescriptor());

You will get an URI and will have to use REST/OSLC to access the details.
Ralph Schoon selected this answer as the correct answer

0 votes

Comments

Hello Ralph,

Thanks for the suggestion.

Is there any sample code to use REST/OSLC?

Thanks.

I am not an OSLC guy, there have ben numerous answers on this forum, so it might be beneficial to search. Also the RTC server uses REST/OSLC, so it might be an idea to search how it does that in the source. Tedios, I know, but that would be my first approach. Maybe als interesting: https://jazz.net/forum/questions/214885/use-current-user-session-to-login-another-project-through-rtc-plugin/215303 maybe these internal interfaces provide a hint?

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

Question asked: Jan 27 '16, 10:42 a.m.

Question was seen: 1,685 times

Last updated: Nov 15 '17, 8:06 a.m.

Confirmation Cancel Confirm