It's all about the answers!

Ask a question

JAVA API to read/write work item query from/to server.


praveen hanchinamani (2717) | asked Apr 28 '17, 2:29 a.m.
edited Apr 28 '17, 2:38 a.m. by Ralph Schoon (61.6k33643)

 Dear all,


I am trying to read out the work item queries created in ALM server( particular to query name, description and conditions mentioned in the query).

As far now, i am able to fetch the IQueryDescriptior & Expression from this query descriptor; from the code snippet shown below - 

IWorkItemClient workItemClient = (IWorkItemClient) teamRepositoryInstance.getClientLibrary(IWorkItemClient.class);
IQueryClient queryClient = workItemClient.getQueryClient();

List queries = queryClient.findPersonalQueries(projectArea.getProjectArea(), loggedInContributor,                   
                      QueryTypes.WORK_ITEM_QUERY,
                      IQueryDescriptor.FULL_PROFILE, 
                      new NullProgressMonitor());

for (Iterator iterator = queries.iterator(); iterator.hasNext();) {
      IQueryDescriptor iQueryDescriptor = (IQueryDescriptor) iterator.next();

      Expression conditions = iQueryDescriptor.getExpression();
}


After this, how can i proceed to get the desired values with proper structure of conditions mentioned in the query?

it would be great if some hint/code snippet is available.

And are there any REST calls to achieve the same?

Thank you.

One answer



permanent link
Ralph Schoon (61.6k33643) | answered Apr 28 '17, 2:43 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Your answer


Register or to post your answer.