It's all about the answers!

Ask a question

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

Jazzuser user (68849) | asked Nov 03 '17, 7:40 a.m.

Hello All,

I need to fetch the Task workitem's Category(Filed Against) value. I am using the following code : 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 org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(

However same code is working fine for other workitems. Is there any other way for accessing the Task's attribute ?

Please assist.

One answer

permanent link
Ralph Schoon (63.1k33646) | answered Nov 03 '17, 8:43 a.m.

I have explained what I know here:
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.

Your answer

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