Java Client API get a query by it's web ID
Hi,
I see that queries in RTC have a web ID showing in their link:
<project URI>/web/projects/<project name>#action=com.ibm.team.workitem.runSavedQuery&id=_YYkhcADzEeiYTtmwfgbVzg
Is there a way to use Java Client API to retrieve a query by the above ID?
All I'v seen so far is how to retrieve a query by its name:
if (iQueryDescriptor.getName().equals(queryName)) {...}
Is there another function I can use to retrieve the query's web ID?
Thanks in advance,
Sara.
One answer
I would assume that the ID you mention is basically the ID of the query descriptor: com.ibm.team.workitem.common.query.IQueryDescriptor.getId()
I think you should be able to get the Id as shown above and compare it. Or you can try to use a query model (see https://rsjazz.wordpress.com/2017/02/14/query-models-or-how-to-find-stuff-with-the-rtc-api/ ) and search for the ID if you have it using the query model, com.ibm.team.workitem.common.internal.query.query.BaseQueryDescriptorQueryModel.id() (note it is internal).