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

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

0 votes



3 answers

Permanent link
I have finally figured out the custom Attributes, after playing around with it a little more.

I am however still stuck as to how to retreive the Status of a WorkItem, since this does not seem to be held within the workItem itself.

0 votes


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

0 votes


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


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

0 votes

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,938

Question asked: Oct 12 '09, 6:44 a.m.

Question was seen: 4,832 times

Last updated: Oct 12 '09, 6:44 a.m.

Confirmation Cancel Confirm