It's all about the answers!

Ask a question

List states which correspond to State Groups with Java Plain API


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

Hello,

In my groovy/java script I get the state group doing:

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)

The stateGroup is an integer that represents: IWorkflowInfo.CLOSED_STATES, IWorkflowInfo.IN_PROGRESS_STATES or IWorkflowInfo.OPEN_STATES

My Question is:

Is there a way to list which states are corresponded to each of them?
For example, for IWorkflowInfo.OPEN_STATES, the states that are corresponded to it are: New, Implemented, etc...

How would be the code?

Thanks a lot for the help.

One answer



permanent link
Ralph Schoon (63.5k33646) | answered Oct 05 '13, 1:03 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 You could use expressions http://rsjazz.wordpress.com/2012/11/19/using-expressions-for-automation/ or (basically the same) http://rsjazz.wordpress.com/2012/10/29/using-work-item-queris-for-automation/ . I am pretty sure you can create an expression for state groups. Since the query editor UI also supports it.

Comments
Ralph Schoon commented Oct 05 '13, 1:48 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Sorry, the answer above would get all work items in such a state group. Not the states in a state group. I assume you have to iterate all workflows, get the states and their state group. I can't look into the API right now, if there is another way. 

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.