It's all about the answers!

Ask a question

Copy the personal queries from a contributor by API


Francisco Javier Moreno López (087) | asked Jun 09 '10, 6:23 a.m.
Hello,
How could I copy the personal queries from a contributor to another by API?
I have obtained the list of contributor's queries (list of IQueryDescriptor), but I dont know how to change the associated contributor in the IQueryDescriptor.
This is the code to obtain de list of IQueryDescriptor:

IQueryClient serviceQuery = (IQueryClient)repo.getClientLibrary(IQueryClient.class);
List <IQueryDescriptor> listQueries = serviceQuery(findPersonalQueries(areaAux.getProjectArea() , contAux, null, IQueryDescriptor.FULL_PROFILE, new NullProgressMonitor());

Thank you very much
Best Regards

One answer



permanent link
Patrick Streule (4.9k21) | answered Jun 11 '10, 9:33 a.m.
JAZZ DEVELOPER
How could I copy the personal queries from a contributor to another by
API?
I have obtained the list of contributor's queries (list of
IQueryDescriptor), but I dont know how to change the associated
contributor in the IQueryDescriptor.
This is the code to obtain de list of IQueryDescriptor:

IQueryClient serviceQuery =
(IQueryClient)repo.getClientLibrary(IQueryClient.class);
List<IQueryDescriptor> listQueries =
serviceQuery(findPersonalQueries(areaAux.getProjectArea() , contAux,
null, IQueryDescriptor.FULL_PROFILE, new NullProgressMonitor());

You can use
com.ibm.team.workitem.client.query.IQueryDescriptorWorkingCopyManager to
get a working copy of the query, change the owner and save the query.

Changing the owner:

com.ibm.team.workitem.common.internal.query.QueryDescriptor.setCreator(IContributorHandle)

--
Regards,
Patrick
Jazz Work Item Team

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.