It's all about the answers!

Ask a question

How to get a list of queries defined in RTC?


Kinny Kun (5183) | asked Mar 03 '09, 8:27 p.m.
Hi,

How can I get a list of queries (both predefined and custom queries) defined in RTC using the client api?

Any help is appreciated. Thanks alot!

3 answers



permanent link
Kinny Kun (5183) | answered Mar 03 '09, 9:04 p.m.
To be more specific, I'm looking for a list of queries that query work items.

Thanks.

Hi,

How can I get a list of queries (both predefined and custom queries) defined in RTC using the client api?

Any help is appreciated. Thanks alot!

permanent link
Kinny Kun (5183) | answered Mar 04 '09, 6:59 p.m.
I'm able to get a list of queries by using QueryDescriptorQueryModel. But now I have another question.

How can I get an IItemQuery object from the IQueryDescripter object?

What I'm trying to do is I have the name (String type) of the query that I want to execute. I assume that I will need to get its query object for the query execution (to get work items). How can I get the query object by the name string?

I can get the IQueryDescripter by name. But what should I do next in order to execute that query?

Please help! Thank you very much.



To be more specific, I'm looking for a list of queries that query work items.

Thanks.

Hi,

How can I get a list of queries (both predefined and custom queries) defined in RTC using the client api?

Any help is appreciated. Thanks alot!

permanent link
Patrick Streule (4.9k21) | answered Mar 13 '09, 5:42 a.m.
JAZZ DEVELOPER
What I'm trying to do is I have the name (String type) of the query
that I want to execute. I assume that I will need to get its query
object for the query execution (to get work items). How can I get the
query object by the name string?

I can get the IQueryDescripter by name. But what should I do next in
order to execute that query?

We currently don't have public API to retrieve a query by name, but you
could do the following:

IAuditableClient auditableClient=...
IQueryClient queryClient=...
ItemQueryIterator<IQueryDescriptorHandle> iterator=
WorkItemQueries.queryDescriptorByName(auditableClient, projectArea, name);
IQueryDescriptorHandle handle= iterator.next(monitor);
IQueryDescriptor query= auditableClient.resolveAuditable(handle,
IQueryDescriptor.FULL_PROFILE, monitor);
results= queryClient.getResolvedQueryResults(query,
IWorkItem.SMALL_PROFILE);

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