Retreiving information from a WorkItem using Plain Java
Hi, I am very new to RTC and have been writing some plain java code to extract information from a workItem.
Assume I have extracted the correct work item and a IWorkItem object has been extracted. I can now extract information such as the creator, severity, owner, amoung other things.
I also have several other attributes such as Category, ODC Impact and a few others which I believe are custom ones. How do I go about accessing the information contained within these fields since the methods do not seem to be there to allow me to do this.
The last one is the Status of the workItem, I need to be able to return a String which contains the current Status of a workItem but I cannot find a way to do this.
Any help on this would be very much appreciated.
Jonathan Taylor
Assume I have extracted the correct work item and a IWorkItem object has been extracted. I can now extract information such as the creator, severity, owner, amoung other things.
I also have several other attributes such as Category, ODC Impact and a few others which I believe are custom ones. How do I go about accessing the information contained within these fields since the methods do not seem to be there to allow me to do this.
The last one is the Status of the workItem, I need to be able to return a String which contains the current Status of a workItem but I cannot find a way to do this.
Any help on this would be very much appreciated.
Jonathan Taylor
3 answers
I also have several other attributes such as Category, ODC Impact and
a few others which I believe are custom ones. How do I go about
accessing the information contained within these fields since the
methods do not seem to be there to allow me to do this.
All attribute values, bot custom and built-in can be accessed using:
IAttribute attribute= workItemClient.findAttribute(projectArea,
IWorkItem.XY_PROPERTY_ID, monitor);
Object value= workItem.getValue(attribute);
The last one is the Status of the workItem, I need to be able to
return a String which contains the current Status of a workItem but I
cannot find a way to do this.
IWorkflowInfo info= workItemClient.findWorkflowInfo(workItem, monitor);
String name= info.getStateName(workItem.getState2());
--
Regards,
Patrick
Jazz Work Item Team
Thankyou very much, thats exactly what I needed. I had managed to get the getStste2() method working but could not find a way to convert this into the actual named values.
Thanks again for the help.
--
Regards
Jon
IBM
All attribute values, bot custom and built-in can be accessed using:
IAttribute attribute= workItemClient.findAttribute(projectArea,
IWorkItem.XY_PROPERTY_ID, monitor);
Object value= workItem.getValue(attribute);
IWorkflowInfo info= workItemClient.findWorkflowInfo(workItem, monitor);
String name= info.getStateName(workItem.getState2());
--
Regards,
Patrick
Jazz Work Item Team
Thanks again for the help.
--
Regards
Jon
IBM
I also have several other attributes such as Category, ODC Impact and
a few others which I believe are custom ones. How do I go about
accessing the information contained within these fields since the
methods do not seem to be there to allow me to do this.
All attribute values, bot custom and built-in can be accessed using:
IAttribute attribute= workItemClient.findAttribute(projectArea,
IWorkItem.XY_PROPERTY_ID, monitor);
Object value= workItem.getValue(attribute);
The last one is the Status of the workItem, I need to be able to
return a String which contains the current Status of a workItem but I
cannot find a way to do this.
IWorkflowInfo info= workItemClient.findWorkflowInfo(workItem, monitor);
String name= info.getStateName(workItem.getState2());
--
Regards,
Patrick
Jazz Work Item Team