[Solved] REST API: Will not include unassigned tasks when using IdentityService.setAuthentication()

I’ve noticed today that my unassigned tasks were not returned in the simple query:

GET http://localhost:8080/engine-rest/task?tenantIdIn=demo
Accept: application/json
Content-Type: application/json
###

I’m setting the user authentication along with its groups and tenants via a filter such as:

@Override
public void doFilter(
        ServletRequest request, ServletResponse response, FilterChain chain
) throws IOException, ServletException {
    String userName = userEntitlements.getUsername();
    try {
        List<String> groupNames = getGroupIds(userName);
        List<String> tenants = userEntitlements.getUserTenantNames(userName);
        processEngine.getIdentityService().setAuthentication(userName, groupNames, tenants);
        chain.doFilter(request, response);
    } finally {
        clearAuthentication(processEngine);
    }
}

This happens in v7.14.0 for a vanilla User Task modeled without any assignee or candidates. The moment I added it to a Candidate Group I am part of, it started to respond with my task. Is this expected?

I assume you’re also using tenants as that’s part of the query - can you confirm there are tasks are associated to the tenant you’re querying for?

Thank you Niall, that was the problem. One of the workflows was mistakenly deployed without a tenant :slight_smile: