How to get the Workitem type properties ?
Accepted answer
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.
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.