How to get workItemId by summary?
Hi
I want to search a work Item by summary? I don't want to pull all the work Item and do search in the summary? Is there any way i can get the list of work item ID whose summary matches to a text without pulling all the work Items . I mean without using this code:- IQueryResult<IResolvedResult<IWorkItem>> results = queryClient.getResolvedExpressionResults(projectArea, expression,IWorkItem.FULL_PROFILE); while(results.hasNext(progressMonitor)){ workItem1= results.next(progressMonitor).getItem(); String summary=workItem1.getHTMLSummary(); } Above displayed code pulls all the work Item which I don't prefer because it is slow and I don't want to pull all the work items cause it might make java run out of memory. Any kind of suggestion will be appreciated. Thanks |
Accepted answer
you would have to use a different expression operation..
use the summary field, operation contains, and text data kishan adhi selected this answer as the correct answer
Comments
kishan adhi
commented May 02 '13, 8:40 p.m.
Can you post syntax or code
sam detweiler
commented May 02 '13, 11:00 p.m.
haven't done it myself. but these are shown to the user so there is probably some function there..
|
One other answer
Thanks Sam
You are a live saver It did work with the concept you gave For other who might need this code: Expression ismyType = new AttributeExpression(type1,AttributeOperation.CONTAINS, summary); IQueryResult<IResolvedResult<IWorkItem>> resultsResolvedss= queryClient.getResolvedExpressionResults(projectArea, ismyType, IWorkItem.FULL_PROFILE); workItem1=null; System.out.println("trail"+resultsResolvedss.getTotalSize(progressMonitor)); while(resultsResolvedss.hasNext(progressMonitor)){ workItem1= resultsResolvedss.next(progressMonitor).getItem(); int workItemID=workItem1.getId(); System.out.println("^*^ "+workItemID+" "+workItem1.getHTMLSummary().getPlainText()); } |
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.