It's all about the answers!

Ask a question

get defect or task owner


Gabi mordov (634) | asked Jun 02 '14, 11:34 p.m.
 Hi all ,
how can i read Task or defect owner by java api???

Thanks
Gabi

2 answers



permanent link
Ajay Mallikarjunaiah (148410) | answered Jun 03 '14, 8:49 a.m.
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

Comments
Gabi mordov commented Jun 05 '14, 12:32 a.m.

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


Ajay Mallikarjunaiah commented Jun 05 '14, 1:16 a.m. | edited Jun 05 '14, 1:36 a.m.

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());



Gabi mordov commented Jun 08 '14, 12:31 a.m.

Thanks allot.

it solved my problem.

have a nice day

gabi 


permanent link
Don Yang (7.7k21109138) | answered Jun 03 '14, 12:49 a.m.
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

Your answer


Register or 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.