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

RTC API Exception : Attempting to get unset feature: Category though the value in the workitem is set.

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.

0 votes



One answer

Permanent link

I have explained what I know here: https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/
I can't identify what rtcDataAccessProvider is. Nor is it clear where in the statement the error actually happens.
attributename is a bad name for the IAttribute, because you use the name to get the IAttribute.

Otherwise it is almost impossible to remote debug this kind of stuff.

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,938

Question asked: Nov 03 '17, 7:40 a.m.

Question was seen: 2,394 times

Last updated: Nov 03 '17, 8:43 a.m.

Confirmation Cancel Confirm