It's all about the answers!

Ask a question

Saving Workitem references


EclipseTalk . (32736161) | asked Mar 29 '10, 2:27 p.m.
Hi
I'm creating and saving WI references as follow on the client side, however I don't find a correspond method (on the client side) for saveWorkItem2() to save a WI with references:
wc = (IWorkItem) workItem.getWorkingCopy(); 

IWorkItemReferences references =
workItemServer.resolveWorkItemReferences(wc, null);
references.add(WorkItemEndPoints.CHILD_WORK_ITEMS,
WorkItemLinkTypes.createWorkItemReference(workItem1));
workItemServer.saveWorkItem2(workItem2, references, null);

Thank you for your help,

One answer



permanent link
Patrick Streule (4.9k21) | answered Mar 30 '10, 12:23 p.m.
JAZZ DEVELOPER
On 3/29/10 8:37 PM, eclipsetalk wrote:
Hi
I'm creating and saving WI references as follow on the client side,
however I don't find a correspond method (on the client side) for
saveWorkItem2() to save a WI with
references:
wc = (IWorkItem)
workItem.getWorkingCopy();
IWorkItemReferences references =
workItemServer.resolveWorkItemReferences(wc, null);
references.add(WorkItemEndPoints.CHILD_WORK_ITEMS,
WorkItemLinkTypes.createWorkItemReference(workItem1));
workItemServer.saveWorkItem2(workItem2, references, null);

Thank you for your help,


You can find an example of how to create a link on the client side in
https://jazz.net/wiki/bin/view/Main/ProgrammaticLinkCreation

Basically, you get the references from the working copy itself:

protected void execute(WorkItemWorkingCopy workingCopy, IProgressMonitor
monitor) throws TeamRepositoryException {
IItemReference reference=
IReferenceFactory.INSTANCE.createReferenceToItem(workItem1);
workingCopy.getReferences().add(WorkItemEndPoints.CHILD_WORK_ITEMS,
reference);
}

--
Regards,
Patrick
Jazz Work Item Team

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.