Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Getting Tasks for another user using SDK API

Avatar

Level 1

I would like to use SDK API to retrive list of tasks for specific user.

Currently it returns the task only for the user whose credentials are used in connection string. I would like to use 'administrator' login and search tasks for another users which are in assigned state.

Here is the example...

    TaskManagerQueryService queryManager = TaskManagerClientFactory.getQueryManager(myFactory);
    TaskFilter filter = queryManager.newTaskFilter();
    filter.setUserId(ProcessUtil.getUserId(myFactory,"cciu1"));
    StatusFilter sf = filter.newStatusFilter();   
    sf.addStatus(StatusFilter.assigned);   
    filter.setStatusFiltering(sf);     //Perform the search  
    List result = queryManager.taskList(filter);

Here I want to get task list for user cciu1 by connecting as 'administrator thru API

Please let me know if you have encountered such conditions in the past.

0 Replies