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

How to get the Workitem type properties ?

Hello Team
I am working on RTC API extensions.

I want to know how can i get the properties of WI programmatically?


I get WI as Story but i am not able to get the Filed Against property of Story programmatically ?



Please help :(

0 votes


Accepted answer

Permanent link
You want to train yourself on using the API. Start here:  https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/
related is https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/

You need to get the IAttribute for IWorkItem.CATEGORY_PROPERTY

IAttribute category = workItemCommon.findAttribute(projectArea, IWorkItem.CATEGORY_PROPERTY, monitor);
Then you can  the value and cast it.
if(workItem.hasAttribute(category )){
Object value = workItem.getValue(category )
}

Please read the post above to get an idea how the API works.
vinitha dsouza selected this answer as the correct answer

0 votes

Comments

Thank you so much for the ans .

The result is displayed in Object format
How do i get the same  result in a string format ?

I tried casting as String it throws me an class cast exception

Consider reading the links I provided above for an answer. Thanks.

Hi Ralph

I used the code provided by the link :
https://rsjazz.wordpress.com/2012/08/20/manipulationg-work-item-enumeration-values/...

But whenever i tried to access it throws me an exception :

 java.lang.ClassCastException: com.ibm.team.workitem.common.internal.model.impl.CategoryHandleImpl cannot be cast to com.ibm.team.workitem.common.model.Identifier

Please need an help :(


The post also says:

If you are just starting with extending Rational Team Concert, start reading this and the linked posts to get some guidance on how to set up your environment.

And I also provided you with the first links in the first answer. An ICategory is not an Enumeration literal. Again, read those posts above carefully.

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: Jun 26 '15, 10:45 a.m.

Question was seen: 2,600 times

Last updated: Jun 30 '15, 3:29 p.m.

Confirmation Cancel Confirm