It's all about the answers!

Ask a question

Problem with adding a custom attribute to a workItem


Jens Kordowski (3651) | asked Aug 22 '08, 4:58 p.m.
Maybe someone can help me with this problem.
I just want to add a custom attribute, which doesn't work for some reason.

public void addAttributes(IWorkItem workItem, List<IAttribute> attList) {
try {
IWorkItem wi = copyManager.getWorkingCopy(workItem);

for (IAttribute elem : attList) {
if (!wi.hasCustomAttribute(elem)){
wi.addCustomAttribute(elem); // ASSERTION FAILED EXCEPTION
}
}
} catch (TeamRepositoryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}


org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.addCustomAttribute(WorkItemImpl.java:2796)

Thanks in advance.

One answer



permanent link
Patrick Streule (4.9k21) | answered Aug 24 '08, 6:50 a.m.
JAZZ DEVELOPER
Maybe someone can help me with this problem.
I just want to add a custom attribute, which doesn't work for some
reason.

Maybe the custom attribute if of a type that is not supported. We
currently support only primitive types and enumerations.

Or maybe the custom attribute was created in a different project area
than the work item.

HTH,
Patrick
Jazz Work Item Team

Your answer


Register or to post your answer.