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

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
 

0 votes


Accepted answer

Permanent link
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

1 vote

Comments

Can you post syntax or code

Thanks for your time

haven't done it myself.  but these are shown to the user so there is probably some function there..

have u looked at the javadoc?


One other answer

Permanent link
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());
           
            }

0 votes

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,941

Question asked: May 02 '13, 3:53 p.m.

Question was seen: 4,401 times

Last updated: May 03 '13, 9:14 a.m.

Confirmation Cancel Confirm