How to set the default value for Planned for attribute using java
Hi All,
The following is my scenario.
I want to set "Unassigned" value to Planned for attribute when the work item is rejected.
When I tried to Loop the iteration I`m able to get only the user defined values but not the deafult value i.e., Unassigned.
My Question is
How to set The Planned for attribute to Unassigned.
One answer
The following is the code snippet for setting the default value fro Planned for attribute
IAttribute plannedforAttribute = workItemServer.findAttribute(workItem.getProjectARea(),IWorkItem.TARGET_PROPERTY,monitor);
the above code is to get the handle for the Planned for Attribute
IWorkItemCopy workItemCopy = (IWorkItem)workItemServer.findworkItemById(workItem.getId(),IworkItem.FULL_PROFILE,monitor).getWorkingCopy);
This is to get the copy of the current work item which is being saved.
workItemCopy.setValue(plannedForAttribute,null);
workItemServer.saveWorkItem3(workItemCopy,null,null,additionalparameters);