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

Work with Query Results in RTC (Java API client side)

 IBM RTC 5.0.2 (client side)


I have query (already build) who return 2 columns with workItem ID and text custom field from all workitems from current Project Area. How can I get only result values, without getting WorkItem from queryResult, and get custom filed from him (it works, but takes a lot of time on big result set)?


my code:
=======================================================================================

IQueryDescriptor query = findPersonalQuery(pa, queryName, mon); //function for find queryDescriptor by name


if (query != null) { //query_find!

IWorkItemClient workItemClient = (IWorkItemClient) repo.getClientLibrary(IWorkItemClient.class);

IQueryClient queryClient = workItemClient.getQueryClient();

IQueryResult unresolvedResults = queryClient.getQueryResults(query);

if (unresolvedResults != null) { //query_OK


long total = unresolvedResults.getTotalSize(mon);

long pages = (total % 256);

long curPage = 0;

ResultSize resultSize = unresolvedResults.getResultSize(mon);

IAuditableCommon auditableCommon = (IAuditableCommon) repo.getClientLibrary(IAuditableCommon.class);



while (unresolvedResults.hasNext(mon)) { //GO_to_results_in_page

IResult result = (IResult) unresolvedResults.next(mon);

IWorkItem workItem = auditableCommon.resolveAuditable((IAuditableHandle) result.getItem(), IWorkItem.FULL_PROFILE, mon);

 

// get custom text attribute

String val = getCustomAttributeValueByIdentifierAsString(workItem, repo, "custom.field.identifer.txt", mon, true);


} //GO_to_results_in_page



} //query_OK

else System.out.println("INFO : no results!");

} //query_find!

else System.out.println("ERROR  : query \"" + queryName + "\" not found!!!");


=======================================================================================

I try use IWorkItem.SMALL_PROFILE  but it did'n get some performance.

0 votes



One answer

Permanent link

 You can only use the API as it is. You can get the result resolved or unresolved. If you want to get at attribute data you have to finally resolve the work item. You can get resolved results and you can use resolve for multiple work items that might perform faster, but ultimately the best way to use a query is to NOT get all work items back but only a subset defined by the conditions.


Here what I know about the API:

0 votes

Comments

Also the query API returns the work items and not the columns. The columns are a UI implementation on a different API level as far as I understand. 

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
× 10,937

Question asked: Jun 25 '19, 9:20 a.m.

Question was seen: 1,952 times

Last updated: Jun 26 '19, 1:44 a.m.

Confirmation Cancel Confirm