Saving Workitem references
![](http://jazz.net/_images/myphoto/c82e54de68bf0d69f704a97a9de7772f.jpg)
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) forsaveWorkItem2() to save a WI with references:
Thank you for your help,
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
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
![](http://jazz.net/_images/myphoto/c82e54de68bf0d69f704a97a9de7772f.jpg)
On 3/29/10 8:37 PM, eclipsetalk wrote:
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
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