Get Macro state of a WorkItem in Java Plain API
Hello,
I know how to get the state of a given workitem:
def workItemClient = (IWorkItemClient)repository.getClientLibrary(IWorkItemClient.class)
IWorkflowInfo info= workItemClient.findWorkflowInfo(wi, mon);
def status = info.getStateName(wi.getState2());
println("\tWorkItem State is: " + status)
But states values might be different depending on the type of WorkItem (Epic, Stories, Tasks, Defects, etc...).
But I know there are other type of states that are more general/macros that applies for all types of WorkItems,
I don't remember how that kind of states are named. Their values are more generic like opened, closed, etc.
So my question is:
How is the name of that type of states more general?
And how is the code to obtain the value of that state for a workitem?
Thanks a lot for the help.
Accepted answer
Comments
Thanks.
I did:
def workItemClient = (IWorkItemClient)repository.getClientLibrary(IWorkItemClient.class)
IWorkflowInfo info= workItemClient.findWorkflowInfo(wi, mon);
def status = info.getStateName(wi.getState2());
println("\tWorkItem State is: " + status)
def stateGroup = info.getStateGroup(wi.getState2());
println("\tWorkItem State Group is: " + stateGroup)
stateGroup is an integer that represents: IWorkflowInfo.CLOSED_STATES, IWorkflowInfo.IN_PROGRESS_STATES or IWorkflowInfo.OPEN_STATES
Question: How to list in my script which states are contained for each of them? For example, for IWorkflowInfo.CLOSED_STATES states that are contained there are New, Implemented, etc...