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

get defect or task owner

 Hi all ,
how can i read Task or defect owner by java api???

Thanks
Gabi

0 votes



2 answers

Permanent link
Hi, Gabi

Please check with sample code in Ralph's blog here:
https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/

There you can find out more than getting work item's owner by Java API.

Thanks

1 vote


Permanent link
Hi Gabi,

Tasks and defects are nothing but workitems. There is a  direct method available to fetch the owner of the workitem.

iWorkItem.getOwner();

It returns IContributorHandle, out of which you can get the original contributor.

Kindly let me know if this is not what you are looking for.

Cheers,
Ajay

0 votes

Comments

Hi Ajay,

i was already tried  iWorkItem.getOwner(); 
and i am getting IContributorHandle.
but how can i get an owner name from this class???

This is my actual problem.

Thanks again
Gabi

You can IItem from IContriubutor in following way, and in turn the name of contributor....,

IContributorHandle iContributorHandle = iWorkItem.getOwner();
IContributor iContributor=(IContributor)repository.itemManager().fetchCompleteItem(iContributorHandle,
                IItemManager.DEFAULT, monitor);
System.out.println(iContributor.getName());


Thanks allot.

it solved my problem.

have a nice day

gabi 

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
× 1,701
× 1,220

Question asked: Jun 02 '14, 11:34 p.m.

Question was seen: 4,895 times

Last updated: Jun 08 '14, 12:31 a.m.

Confirmation Cancel Confirm