It's all about the answers!

Ask a question

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


kishan adhi (44279) | asked Apr 30 '13, 3:58 p.m.
edited May 01 '13, 1:53 p.m.
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

Accepted answer


permanent link
kishan adhi (44279) | answered May 01 '13, 1:50 p.m.
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

3 other answers



permanent link
Ralph Schoon (62.0k33643) | answered May 01 '13, 3:47 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

permanent link
kishan adhi (44279) | answered May 01 '13, 1:53 p.m.
Resolved   

permanent link
Sourabh Gupta (11) | answered Sep 07 '18, 9:26 a.m.

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

Your answer


Register or to post your answer.