It's all about the answers!

Ask a question

How to get the status of a Workitem Using java API


vinitha dsouza (147123136) | asked Dec 03 '15, 8:50 a.m.
Hello Team

I am working on RTC changemanagment.

I want to retrieve the Status of a workitem.

Here is the code i used to get the Status of a Workitem
IAttribute statusAttribute= workItemClient.findAttribute(projectArea, IWorkItem.STATE_PROPERTY, monitor);

 IWorkflowInfo workflowInfo = workItemClient.findWorkflowInfo(copiedWorkItem,  monitor);
            String currentStatus = workflowInfo.getStateName(copiedWorkItem.getState2());


But Whenever i Use the Above code I get the following exception ..

Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/icu/util/ULocale
    at com.ibm.team.workitem.common.internal.util.LocalizationContext.findProjectAreaLocale(LocalizationContext.java:159)
    at com.ibm.team.workitem.common.internal.util.LocalizationContext.createProjectAreaContext(LocalizationContext.java:48)
    at com.ibm.team.workitem.common.internal.workflow.WorkflowManager.updateCache(WorkflowManager.java:660)
    at com.ibm.team.workitem.common.internal.util.CacheHelper.internalCheckCache(CacheHelper.java:107)
    at com.ibm.team.workitem.common.internal.util.CacheHelper.checkCache(CacheHelper.java:73)
    at com.ibm.team.workitem.common.internal.util.CacheHelper.checkCache(CacheHelper.java:65)
    at com.ibm.team.workitem.common.internal.workflow.WorkflowManager.getProjectAreaRegistry(WorkflowManager.java:593)
    at com.ibm.team.workitem.common.internal.workflow.WorkflowManager.getWorkflowIdForCategory(WorkflowManager.java:463)
    at com.ibm.team.workitem.common.internal.workflow.WorkflowManager.getWorkflowId(WorkflowManager.java:433)
    at com.ibm.team.workitem.common.internal.workflow.WorkflowManager.getBoundWorkflowInfo(WorkflowManager.java:520)
    at com.ibm.team.workitem.common.internal.workflow.WorkflowManager.getWorkflowInfo(WorkflowManager.java:510)
    at com.ibm.team.workitem.common.internal.WorkItemCommon.findWorkflowInfo(WorkItemCommon.java:1249)
    at com.bosch.rtc.utils.workitem.graphtraversal.JGraphTCreationWIVisitor.visitWorkItemLink(JGraphTCreationWIVisitor.java:243)

Caused by: java.lang.ClassNotFoundException: com.ibm.icu.util.ULocale
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 19 more

Please Help ?

One answer



permanent link
Ralph Schoon (63.5k33646) | answered Dec 03 '15, 10:21 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I use the code here: https://rsjazz.wordpress.com/2012/11/26/manipulating-work-item-states/ and here: https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/

The code works for me. You don't have a problem with your code. The error tells you, that you have a problem with the libraries and/or dependencies in your code. You don't have the dependency to com.ibm.icu or to the bundle that includes it, or you don't have the plain Java client Libraries available that contain it. This is a Java usage problem and not an API problem.

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.