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

Plain Java API to display all the work Item type??

Hi,
I am trying to display the Id of all the work Item I mean everything (resolved ,archived ...)
Some how i am not getting the complete list I am missing the defect which I created and and in a status new

The code which I am using is
IProgressMonitor progressMonitor = new NullProgressMonitor();
IAuditableClient auditableClient = (IAuditableClient)teamRepository.getClientLibrary(IAuditableClient.class);

 IQueryClient queryClient = (IQueryClient) teamRepository.getClientLibrary(IQueryClient.class);
 IQueryableAttribute attribute=QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectArea,IWorkItem.PROJECT_AREA_PROPERTY, auditableClient, null);

        Expression expression = new AttributeExpression(attribute, AttributeOperation.EQUALS, projectArea);
              
 IQueryResult<IResolvedResult<IWorkItem>> results = queryClient.getResolvedExpressionResults(projectArea, expression, IWorkItem.FULL_PROFILE);

            while(results.hasNext(progressMonitor)){
                IWorkItem workItem= results.next(progressMonitor).getItem();
                int workItemID=workItem.getId();
                 System.out.println(workItemID+"       "+workItem.getWorkItemType());   
}




Any kind of help is appreciated
Thanks

0 votes


Accepted answer

Permanent link
IProgressMonitor progressMonitor = new NullProgressMonitor();
            ItemProfile<IWorkItem> arg1 = IWorkItem.FULL_PROFILE;
            IWorkItem foundId = workItemClient.findWorkItemById(ticketId, arg1, progressMonitor);


This solves the issue.

Problem with my precious code was in RTC by default the Maximum Query Result Set Size was set to 1000 so I was not getting all the work Item I was only getting 1000 work Items


Ralph Schoon selected this answer as the correct answer

0 votes


3 other answers

Permanent link
 For how to avoid the limit see https://rsjazz.wordpress.com/2012/11/19/using-expressions-for-automation/  

1 vote


Permanent link
Resolved   

0 votes


Permanent link

kishan, Can you please tell where to add those two lines and what is the ticketId variable??

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

Question asked: Apr 30 '13, 3:58 p.m.

Question was seen: 5,667 times

Last updated: Sep 07 '18, 9:26 a.m.

Confirmation Cancel Confirm