It's all about the answers!

Ask a question

How to: Get referenced defect?

Timur Markunin (6495166146) | asked Oct 16 '12, 4:38 a.m.

I'm trying to check state of referenced work item during Save operation.
I use following code:

List<IReference> wir = iwr.getReferences(epdl.get(i));
                                        for(int j=0;j<wir.size();j++)

                                            System.out.println("looping thru references");

                                            // if this is to an item.. should always be

                                                // get the item, and it SHOULD always be a workitem
                                                IWorkItem r = iac.resolveAuditable((IWorkItemHandle)wir.get(j).resolve(),IWorkItem.FULL_PROFILE, null);

It works OK when referenced work item type is story or task. But if it is defect wir.get(j).isItemReference() returns false.
Should I use wir.get(j).isURIReference() ? How could I resolve this link to IWorkItem?

-thanks in advance

One answer

permanent link
Ralph Schoon (63.2k33646) | answered Oct 16 '12, 7:24 a.m.
Hi timur,

have you looked at the examples here: and here: ?

If the reference is no item reference, it is probably a CLM link, for example a change set or a test case etc. that is referenced by URI.

Your answer

Register or 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.