It's all about the answers!

Ask a question

How to create query using IQueryDescriptorWorkingCopyManager


Jia Jia Li (8057155192) | asked Jan 04 '12, 7:02 a.m.
How to create query using IQueryDescriptorWorkingCopyManager?

I use one exist query and modify the expression, but seems queryDes.setExpression(expression) does not work.
Anyone can help?

ItemQueryIterator<IQueryDescriptorHandle> iterator=
WorkItemQueries.queryDescriptorByName(auditableClient, projectArea, "all work items");
IQueryDescriptorHandle queryhandle= iterator.next(null);
IQueryableAttribute similarityAttribute= findAttribute(projectArea, auditableClient, IWorkItem.SUMMARY_PROPERTY, null);

IQueryDescriptorWorkingCopyManager queryWorkingCopyManager = queryClient.getWorkingCopyManager();
queryClient.getWorkingCopyManager().connect(queryhandle, null); QueryDescriptorWorkingCopy querywc = (QueryDescriptorWorkingCopy) queryWorkingCopyManager.getWorkingCopy(queryhandle);
QueryDescriptor queryDes = (QueryDescriptor) querywc.getQueryDescriptor();
AttributeExpression expression= new AttributeExpression(similarityAttribute, AttributeOperation.EQUALS, "aa");
queryDes.setExpression(expression);

One answer



permanent link
Ralph Schoon (63.2k33646) | answered Feb 13 '12, 6:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You might want to look here:

https://jazz.net/forums/viewtopic.php?p=57252
https://jazz.net/wiki/pub/Main/QueryDevGuide/DupeFinder.java

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.