It's all about the answers!

Ask a question

Get Macro state of a WorkItem in Java Plain API


Tiago Fernandez (5351619) | asked Oct 04 '13, 11:21 a.m.

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


permanent link
Ralph Schoon (63.3k33646) | answered Oct 04 '13, 12:13 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 You talk about state groups. The state group of a state should be accessible in the workflow info.
Tiago Fernandez selected this answer as the correct answer

Comments
Tiago Fernandez commented Oct 04 '13, 2:07 p.m.

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

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.