It's all about the answers!

Ask a question

[closed] Getting Java class cast exception


lakshmi jyothsna (37118) | asked Feb 01 '17, 6:56 a.m.
closed Feb 01 '17, 7:41 a.m. by Ralph Schoon (63.3k33646)

 I want to get the owner ID of the work item. I used the below snippet to get the ID . But i end up with an error java class cast exception,


    IContributor contributor = (IContributor) teamRepository.itemManager() 
                .fetchCompleteItem(handle, IItemManager.DEFAULT, null); 
        String userID=contributor.getUserId(); 
Please help me how to get Owner ID  from Icontributor handle.

Please any one clarify the difference between Owner and Creator of work item in RTC.

Waiting forward for response...
Thanks in advance,.

The question has been closed for the following reason: "Duplicate Question" by rschoon Feb 01 '17, 7:41 a.m.

One answer



permanent link
Ralph Schoon (63.3k33646) | answered Feb 01 '17, 7:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 See https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/ to understand how to get the owner.


IContributorHandle owner = workItem.getOwner();