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

How to: Get referenced defect?

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

0 votes



One answer

Permanent link
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.

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

Question asked: Oct 16 '12, 4:38 a.m.

Question was seen: 4,017 times

Last updated: Oct 16 '12, 7:24 a.m.

Confirmation Cancel Confirm