Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

List states which correspond to State Groups with Java Plain API

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.

0 votes



One answer

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

0 votes

Comments

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927
× 478
× 411
× 169

Question asked: Oct 05 '13, 11:35 a.m.

Question was seen: 7,782 times

Last updated: Oct 05 '13, 1:48 p.m.

Confirmation Cancel Confirm