nullpointer Exception when setting category to null
Hi,
I have a plugin that deletes all information from workitem and setting it's type to some custom "archived" type.
All is working fine, except when setting the category to null.
I have tried setting to "unassigned" too, same behavior.
It looks like that:
IWorkItem workItem = wc.getWorkItem();
workItem.setOwner(contributorManager
.fetchContributorByUserId("unassigned", null));
workItem.setTarget(null);
// workItem.setCategory(null);
IAttribute attrType = workItemClient.findAttribute(
projectArea, IWorkItem.TYPE_PROPERTY, null);
IWorkItemType zArchivedType = workItemCommon
.findWorkItemType(projectArea, "archived", null);
workItem.setValue(attrType, zArchivedType.getIdentifier());
IWorkItemReferences references = wc.getReferences();
List<IEndPointDescriptor> refTypes = references.getTypes();
for (IEndPointDescriptor endPointDescriptor : refTypes) {
List<IReference> refList = references
.getReferences(endPointDescriptor);
for (IReference reference : refList) {
references.remove(reference);
}
}
IDetailedStatus status = wc.save(null);
I have a plugin that deletes all information from workitem and setting it's type to some custom "archived" type.
All is working fine, except when setting the category to null.
I have tried setting to "unassigned" too, same behavior.
It looks like that:
IWorkItem workItem = wc.getWorkItem();
workItem.setOwner(contributorManager
.fetchContributorByUserId("unassigned", null));
workItem.setTarget(null);
// workItem.setCategory(null);
IAttribute attrType = workItemClient.findAttribute(
projectArea, IWorkItem.TYPE_PROPERTY, null);
IWorkItemType zArchivedType = workItemCommon
.findWorkItemType(projectArea, "archived", null);
workItem.setValue(attrType, zArchivedType.getIdentifier());
IWorkItemReferences references = wc.getReferences();
List<IEndPointDescriptor> refTypes = references.getTypes();
for (IEndPointDescriptor endPointDescriptor : refTypes) {
List<IReference> refList = references
.getReferences(endPointDescriptor);
for (IReference reference : refList) {
references.remove(reference);
}
}
IDetailedStatus status = wc.save(null);
2 answers
I have a plugin that deletes all information from workitem and setting
it's type to some custom "archived" type.
All is working fine, except when setting the category to null.
I have tried setting to "unassigned" too, same behavior.
The category must not be 'null'. But setting it to 'Unassigned' should
work. Please see also
com.ibm.team.workitem.common.IWorkItemCommon.findUnassignedCategory(IProjectAreaHandle,
ItemProfile<ICategory>, IProgressMonitor)
--
Regards,
Patrick
Jazz Work Item Team
I have a plugin that deletes all information from workitem and setting
it's type to some custom "archived" type.
All is working fine, except when setting the category to null.
I have tried setting to "unassigned" too, same behavior.
The category must not be 'null'. But setting it to 'Unassigned' should
work. Please see also
com.ibm.team.workitem.common.IWorkItemCommon.findUnassignedCategory(IProjectAreaHandle,
ItemProfile<ICategory>, IProgressMonitor)
--
Regards,
Patrick
Jazz Work Item Team
What about setting Release to 'Unassigned'? I can't find a release eith this name using com.ibm.team.workitem.common.IWorkItemCommon.findDeliverableByName(...)