It's all about the answers!

Ask a question

Is there a way to programatically full text search?


Tory Jaskoviak (52015) | asked Apr 24 '13, 6:26 p.m.
JAZZ DEVELOPER
I am using the RTC SDK to programatically query for work items. I have working code where I can refine my search based on attributes like type, status, and associated project area.

Is there a way to add a full text search attribute into my query?

A boiled down version of my code is as follows:

    private static IQueryResult<IResolvedResult<IWorkItem>> performQuery(ITeamRepository repo, String projectAreaName) throws TeamRepositoryException {
       
        final IProcessClientService processClient = (IProcessClientService) repo.getClientLibrary(IProcessClientService.class);
        final IQueryClient queryClient = (IQueryClient) repo.getClientLibrary(IQueryClient.class);
        final IAuditableClient auditableClient = (IAuditableClient) repo.getClientLibrary(IAuditableClient.class);
       
        // Connecting to Project Area
        final URI uri = URI.create(projectAreaName.replaceAll(" ", "%20"));
        final IProjectArea projectArea = (IProjectArea) processClient.findProcessArea(uri, null, monitor);

        // Current Project Area
        final IQueryableAttribute projectAreaAttribute = findAttribute(projectArea, IWorkItem.PROJECT_AREA_PROPERTY, auditableClient, monitor);
        final AttributeExpression projectAreaExpression = new AttributeExpression(projectAreaAttribute, AttributeOperation.EQUALS, projectArea);
               
        // Escalation Type
        final IQueryableAttribute typeAttribute = findAttribute(projectArea, IWorkItem.TYPE_PROPERTY, auditableClient, monitor);
        final AttributeExpression typeExpression = new AttributeExpression(typeAttribute, AttributeOperation.MATCHES, "escalation");
       
        final Term term = new Term(Operator.AND);
        term.add(projectAreaExpression);
        term.add(typeExpression);

        final IQueryResult<IResolvedResult<IWorkItem>> result = queryClient.getResolvedExpressionResults(projectArea, term, IWorkItem.FULL_PROFILE);
       
        return result;
    }

Accepted answer


permanent link
Ralph Schoon (63.5k33646) | answered Apr 25 '13, 2:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Tory Jaskoviak selected this answer as the correct answer

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.