How can I get the list of the columns of a query using Plain API?
Hi, I've a shared query (an IQueryDescriptor) that I've obtained and used to get the result list (which is the list of work items returned by the query). I would like to know which are the field used in the query as output (the column list to be clear).
How can I obtain them?
Thanks,
Michele.
How can I obtain them?
Thanks,
Michele.
2 answers
In the Eclipse client, the com.ibm.team.workitem.ide.ui.internal.queryeditor.QueryEditorInput has a getConfiguration() method to return com.ibm.team.workitem.ide.ui.internal.queryeditor.QueryEditorConfiguration which has methods like getColumnAttributes(), getDefaultColumns(), getDefaultSortOrder(). Maybe it could help you...
Cheers.
Comments
sam detweiler
May 20 '16, 7:56 a.m.in my execute shared query code, I supply the profile for the workitems.
see my code in the accepted answer here
https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes
private static void printResolved(IQueryClient queryClient,
IQueryDescriptor queryToRun,
how did u execute the query?
I did
IQueryResult<IResolvedResult<IWorkItem>> resolvedResults = queryClient
.getResolvedQueryResults(queryToRun, IWorkItem.FULL_PROFILE);
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 20 '16, 8:49 a.m.Sam, the question as I understand it is, how to get the output columns (and parameters) that are specified for the query to print them according to the query specification.
Michele Pegoraro
May 20 '16, 8:57 a.m.Yes, it is correct. I'm already using the full profile otherwise I would not be able to get the values. I'm ok with the query results as work item list, I'm trying to get the query configuration for the output.
sam detweiler
May 20 '16, 9:14 a.m.yes, I understand what the question was..
I don't see that data in the query descriptor tho.. parameters is the filter for WHICH workitems, not the column contents.. t would make sense that there is a profile object saved with the query descriptor someplace.