It's all about the answers!

Ask a question

How to: Get referenced defect?


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

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
                                            if(wir.get(j).isItemReference())

                                            {   
                                                // 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 (60.7k33643) | answered Oct 16 '12, 7:24 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi timur,

have you looked at the examples here: https://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/ and here: https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/ ?

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.