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

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.

0 votes


Accepted answer

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

0 votes

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

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,935
× 478
× 411

Question asked: Oct 04 '13, 11:21 a.m.

Question was seen: 4,990 times

Last updated: Oct 04 '13, 2:07 p.m.

Confirmation Cancel Confirm