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

How to add predecessor programmaticaly?

Hi,

I have followed the below link to create new work item using plain java client library.

https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation


Let me know how to add predecessors to the work item.



Thanks,

Pugazh

0 votes



One answer

Permanent link
find the solution below.

/***************** set predecessors *****************************/
if(fpredecessors>0)
setPredecessors(workingCopy,cawobj.fetchWorkItemsByID(fpredecessors));



private void setPredecessors(WorkItemWorkingCopy wc, IWorkItem parent) {

IEndPointDescriptor referenceType= WorkItemEndPoints.PREDECESSOR_WORK_ITEMS;
IReference reference= WorkItemLinkTypes.createWorkItemReference(parent);
wc.getReferences().add(referenceType, reference);

}

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

Question asked: Apr 16 '12, 1:28 a.m.

Question was seen: 4,997 times

Last updated: Apr 16 '12, 1:28 a.m.

Confirmation Cancel Confirm