How can I get a STATE Name of workitem in RTCClientplainJava
![]()
Hi,
i hope this is a simple Question. I want to get the STATE name of a work item, i tried with the below code it returns the State not the Name. workItem.getState2().getStringIdentifier() |
Accepted answer
![]() It's very old question but I hope it will help someone.
private String getStateName(IWorkItem workItem, IProgressMonitor monitor) throws TeamRepositoryException {
if (workItem != null) { Identifier<IState> state = workItem.getState2(); IWorkflowInfo workflowInfo = workItemClient.findWorkflowInfo(workItem, monitor); return workflowInfo.getStateName(state); } return null;
}
Ralph Schoon selected this answer as the correct answer
|
2 other answers
![]()
I don't know how to get the first data item in a client
but here is a snippet of code I use in an Advisor. you need the IWorkflowInfo object for this workitem. IAuditableCommon iac = ((ISaveParameter) data).getSaveOperationParameter().getAuditableCommon(); |
![]()
We found a solution in this post: https://jazz.net/forums/viewtopic.php?p=74030#74030 But that method com.ibm.team.workitem.client.WorkflowUtilities.findWorkflowInfo(IWorkItem, IProgressMonitor).getStateName(Identifier<IState>)is not very perfomant... :? |