It's all about the answers!

Ask a question

Can't save work item ( Java API - Server Side )

Ardy Lesmana (134) | asked Sep 07 '17, 3:22 a.m.
edited Sep 07 '17, 3:36 a.m.

 I have this code 

 private boolean updateParent(ISaveParameter saveParameter, List<IWorkItemHandle> childs_handle,IProgressMonitor monitor) throws TeamRepositoryException {
String child_update = "";
IWorkItem parents = (IWorkItem)saveParameter.getNewState(); 
IAttribute Prodd = fWorkItemCommon.findAttribute(
parents.getProjectArea(), Product_Name,
for (IWorkItemHandle childs: childs_handle){
IWorkItem child_workitem = (IWorkItem) fWorkItemServer
.resolveAuditable(childs, IWorkItem.FULL_PROFILE, monitor)
Object x = childValue(parents,child_workitem,monitor);
child_update = child_update + " " + x .toString();
IWorkItem parent= (IWorkItem)fWorkItemServer.getAuditableCommon().resolveAuditable(parents ,IWorkItem.LARGE_PROFILE,monitor).getWorkingCopy();
parent.setValue(Prodd, child_update);
// Save the work item with an information that could be used to prevent
// recursive ascent.
Set<String> additionalParams = new HashSet<String>();
IStatus saveStatus = fWorkItemServer.saveWorkItem3(parent, null, null,
if (!saveStatus.isOK()) {
return false;

return true;
private Object childValue(IWorkItem parents, IWorkItem child, IProgressMonitor monitor) throws TeamRepositoryException {
IAttribute Prod_pre = fWorkItemCommon.findAttribute(
parents.getProjectArea(), Product_pre,
Object x = child.getValue(Prod_pre);
return x;

When I tried to run the API I got this kind of error: 

Be the first one to answer this question!

Register or to post your answer.