Hello All,
I need to fetch the Task workitem's Category(Filed Against) value. I am using the following code :
com.ibm.team.workitem.common.model.IAttribute attributename=rtcDataAccessProvider.getWorkItemClient((ITeamRepository)currentWorkItem.getOrigin()).findAttribute(currentWorkItem.getProjectArea(), IWorkItem.CATEGORY_PROPERTY, monitor);
if(currentWorkItem.hasAttribute(attributename )){
Object value =currentWorkItem.getValue(attributename);
}
Am getting the following exception, though the category value is set for the Task.
Exception in thread "main" java.lang.IllegalStateException: Attempting to get unset feature: Category
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.getCategory(WorkItemImpl.java:1672)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.eGet(WorkItemImpl.java:2352)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1021)
However same code is working fine for other workitems. Is there any other way for accessing the Task's attribute ?
Please assist.