Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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);

0 votes



2 answers

Permanent link
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

0 votes


Permanent link
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(...)

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: Jan 10 '10, 5:39 a.m.

Question was seen: 6,624 times

Last updated: Jan 10 '10, 5:39 a.m.

Confirmation Cancel Confirm