It's all about the answers!

Ask a question

How to read the value of an attribute of a workitem with Plain Java API?

Denes Elo (1529) | asked Aug 10 '17, 8:33 a.m.
edited Aug 10 '17, 8:57 a.m. by Ralph Schoon (63.3k33646)

The workitem has some attributes: Type, Tags, Task Completion, Severity, Status... I need from these the value of Status (smallstring) . I get the identifier of the Status it is internalState.

workItem = copy.getWorkItem(); status = workItemClient
                            "internalState", null);


I don't know why I get this Exception:

java.lang.IllegalStateException: Attempting to get unset feature: Creator at at at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet( at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet( at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet( at at at at Sample.analyzeItem( at Sample.analyzeReference( at at Sample.main(

The exception thrown when i call the getValue() function. If somebody know the problem please show some example code!

Thanks your help!!

Accepted answer

permanent link
Ulf Arne Bister (1.3k413) | answered Aug 10 '17, 10:22 a.m.


please find sample code and considerations at

I assume your work item was resolved using a profile that does not include the attribute. Compare this entry:

If that is not solving the issue you are possibly getting a work item which does not have the attribute set yet. Please consider using the

if (workItem.hasCustomAttribute(customString)){
    Object value = workItem.getValue(customString);
    if (value instanceof String) {
        String attributeValue = (String) value;
        // do something with the value
code fragment from the article.

If this answers your question please mark the answer as accepted.

- Arne

Denes Elo selected this answer as the correct answer

Denes Elo commented Aug 11 '17, 2:44 a.m.

Thanks! I opened the SMALL_PROFILE, now I open with FULL_PROFILE and everything works fine.

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.