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

Obtain a task the first predecessor (Participants plugin)

I explained i have (sorry my english is bad):

I want to get the task A "IWorkItemHandle" when you save a value of task C

   Task A (succesor Task B)

          ---> Task B (predecesor Task A, succesor task C)

                       ---->  Task C (predecesor Task B)

My code is (Participant plugin):

  ISaveParameter saveParameter = (ISaveParameter) data;
List<IReferences> references=saveParameter.getNewReferences().getReferences(WorkItemEndPoints.PREDECESSOR_WORK_ITEMS) ;

if (references.isEmpty()) {
   return null;
  }

  for (IReference reference : references) {
   if (reference.isItemReference()) {
    Object obj = reference.resolve();
      if (obj instanceof IWorkItemHandle) {
          System.out.println("6 -->" + reference.getLink().getOtherRef(reference));
         return (IWorkItemHandle) obj;
    } // end if
   } // end if
  }// end for

0 votes



One answer

Permanent link
once you have B in your code, you need to repeat the same operations using B as the current workitem to get its parent.

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

Question asked: Sep 12 '12, 6:06 a.m.

Question was seen: 2,992 times

Last updated: Sep 13 '12, 6:57 a.m.

Confirmation Cancel Confirm