It's all about the answers!

Ask a question

List of States for a work item


Maria Velasco (4641) | asked Feb 12 '09, 4:49 p.m.
Hello,

How can i get a list of states for a work item?

Thank you!

7 answers



permanent link
Patrick Streule (4.9k21) | answered Feb 13 '09, 4:18 a.m.
JAZZ DEVELOPER
How can i get a list of states for a work item?

You would get the workflow information for a work item first:
IWorkflowInfo workflow= workItemCommon.findWorkflowInfo(workItem, monitor)

Then you can read the workflow's states, resolutions and actions, e.g.
workflow.getAllStateIds()

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Maria Velasco (4641) | answered Feb 18 '09, 1:48 p.m.
Hi Patrick,

It seems that when we try IWorkflowInfo workflow= workItemCommon.findWorkflowInfo(workItem, monitor), we get an IllegalArgumentException, any idea what might cause this?

Thanks!

How can i get a list of states for a work item?

You would get the workflow information for a work item first:
IWorkflowInfo workflow= workItemCommon.findWorkflowInfo(workItem, monitor)

Then you can read the workflow's states, resolutions and actions, e.g.
workflow.getAllStateIds()

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Maria Velasco (4641) | answered Feb 18 '09, 2:00 p.m.
Hey Patrick,

Would you have a different way to get the states?

Thanks again!

Hi Patrick,

It seems that when we try IWorkflowInfo workflow= workItemCommon.findWorkflowInfo(workItem, monitor), we get an IllegalArgumentException, any idea what might cause this?

Thanks!

How can i get a list of states for a work item?

You would get the workflow information for a work item first:
IWorkflowInfo workflow= workItemCommon.findWorkflowInfo(workItem, monitor)

Then you can read the workflow's states, resolutions and actions, e.g.
workflow.getAllStateIds()

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Maria Velasco (4641) | answered Feb 18 '09, 2:01 p.m.
Hey Patrick,

Would you have a different way to get the states?

Thanks again!

Hi Patrick,

It seems that when we try IWorkflowInfo workflow= workItemCommon.findWorkflowInfo(workItem, monitor), we get an IllegalArgumentException, any idea what might cause this?

Thanks!

How can i get a list of states for a work item?

You would get the workflow information for a work item first:
IWorkflowInfo workflow= workItemCommon.findWorkflowInfo(workItem, monitor)

Then you can read the workflow's states, resolutions and actions, e.g.
workflow.getAllStateIds()

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Maria Velasco (4641) | answered Feb 18 '09, 2:03 p.m.
Hey Patrick,

Would you have a different way to get the states?

Thanks again!

Hi Patrick,

It seems that when we try IWorkflowInfo workflow= workItemCommon.findWorkflowInfo(workItem, monitor), we get an IllegalArgumentException, any idea what might cause this?

Thanks!

How can i get a list of states for a work item?

You would get the workflow information for a work item first:
IWorkflowInfo workflow= workItemCommon.findWorkflowInfo(workItem, monitor)

Then you can read the workflow's states, resolutions and actions, e.g.
workflow.getAllStateIds()

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Patrick Streule (4.9k21) | answered Feb 19 '09, 8:58 a.m.
JAZZ DEVELOPER
It seems that when we try IWorkflowInfo workflow=
workItemCommon.findWorkflowInfo(workItem, monitor), we get an
IllegalArgumentException, any idea what might cause this?

Could you paste your code snippet and the stack trace? That would tell me
where the IllegalArgumentException comes from and what its cause could be.

--
Regards,
Patrick
Jazz Work Item Team

permanent link
John Doran (9182) | answered Mar 10 '09, 7:15 p.m.
How can i get a list of states for a work item?

You would get the workflow information for a work item first:
IWorkflowInfo workflow= workItemCommon.findWorkflowInfo(workItem, monitor)

Then you can read the workflow's states, resolutions and actions, e.g.
workflow.getAllStateIds()

--
Regards,
Patrick
Jazz Work Item Team

Another way to do this might be ....

IWorkItemClient workItemClient = (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);

IWorkflowInfo wfInfo = workItemClient.findWorkflowInfo(workItem, monitor);


instead of using WorkItemCommon which is internal.

Your answer


Register or to post your answer.