It's all about the answers!

Ask a question

Checking and changing work item status


Anna Wymyslowska (112) | asked Nov 25 '08, 3:38 a.m.
How can I check work item status from Java program for example if it is not "New" and change it to "Reopen".
Thank you

3 answers



permanent link
Patrick Streule (4.9k21) | answered Nov 25 '08, 1:38 p.m.
JAZZ DEVELOPER
How can I check work item status from Java program for example if it
is not "New" and change it to "Reopen".
Thank you

IWorkflowInfo contains the information you need. As workflows are entirely
customizable, you shouln't rely on identifiers or even names of specific
states:

IWorkflowInfo#getReopenActionId() gives you the action ID of the reopen
action regardless of the specific workflow. You pass the action into the
save work item call to change the state of the work item (the state cannot
be set directly).

IWorkflowInfo#getStateGroup(state) gives you the information whether a
work item is in an 'open' or 'in progress' or 'closed' state, regardless
of the exact configured state.

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Anna Wymyslowska (112) | answered Nov 26 '08, 4:09 a.m.
so how can I initialize IWorkflowInfo class object?
I can not find any documentation :/

permanent link
Patrick Streule (4.9k21) | answered Nov 26 '08, 6:08 a.m.
JAZZ DEVELOPER
so how can I initialize IWorkflowInfo class object?
I can not find any documentation :/

You can get IWorkflowInfo by using:
IWorkItemCommon#IWorkflowInfo findWorkflowInfo(IWorkItem workItem,
IProgressMonitor monitor)

--
Regards,
Patrick
Jazz Work Item Team

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.