Task report not showing "Assigned" tasks

Certified Associate Developer

Hello!

I have a task report which shows tasks from all users that have the current logged in user as their supervisor.  

The problem I'm facing is that tasks with the status "Assigned" are not being shown in the report, which in turn creates a problem where if I reassign a task from someone it immediately goes to status "Assigned" and stops being shown in the report. 

Here is how I pick up tasks from my subordinates.

a!localVariables(
        local!currentUser: loggedInUser(),
        local!directReportUsers: a!queryRecordType(
          recordType: 'recordType!{SYSTEM_RECORD_TYPE_USER}User',
          fields: 'recordType!{SYSTEM_RECORD_TYPE_USER}User.relationships.{SYSTEM_RECORD_TYPE_USER_RELATIONSHIP_directReportUsers}directReportUsers.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_username}username',
          filters: a!queryFilter(
            field: 'recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_username}username',
            operator: "=",
            value: local!currentUser
          ),
          pagingInfo: a!pagingInfo(
            startIndex: 1,
            batchSize: 100
          )
        ).data,
        local!reportUsers: local!directReportUsers['recordType!{SYSTEM_RECORD_TYPE_USER}User.relationships.{SYSTEM_RECORD_TYPE_USER_RELATIONSHIP_directReportUsers}directReportUsers.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_username}username']

If anyone had the same problem or if anyone has any insights on this it would be greatly appreciated.

Jan

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I assume you use a process report to show these tasks. How is this configured? And how do you filter the query?

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    Yes I use a process report which is configured to show all tasks from everyone. 

    Then I use the code below to actually filter the task to show only tasks from the users subordinates.

    local!taskReportData: a!refreshVariable(
              refreshOnVarChange: local!refreshTrigger,
              value: a!queryProcessAnalytics(                                         
                report: cons!GBKR_ALL_TASKS,                                  
                query: a!query(
                  pagingInfo: a!pagingInfo(                                    
                    startIndex: 1,                                             
                    batchSize: 500,                                             
                    sort: a!sortInfo(                                          
                      field: "c2",                                             
                      ascending: true                                          
                    )                                                          
                  ),
                  logicalExpression: a!queryLogicalExpression(
                    operator: "AND",
                    filters: 
                    {
                      a!queryFilter(
                        field: "c4",                                                
                        operator: "in",                                             
                        value: local!reportUsers
                      ),
                      a!queryFilter(                                        
                        field: "c1",                                                
                        operator: "in",                                             
                        value: local!statusFilter,                                  
                        applyWhen: a!isNotNullOrEmpty(local!statusFilter)
                      )
                    }
                  )                                                            
                )
              )
            ),

Reply
  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    Yes I use a process report which is configured to show all tasks from everyone. 

    Then I use the code below to actually filter the task to show only tasks from the users subordinates.

    local!taskReportData: a!refreshVariable(
              refreshOnVarChange: local!refreshTrigger,
              value: a!queryProcessAnalytics(                                         
                report: cons!GBKR_ALL_TASKS,                                  
                query: a!query(
                  pagingInfo: a!pagingInfo(                                    
                    startIndex: 1,                                             
                    batchSize: 500,                                             
                    sort: a!sortInfo(                                          
                      field: "c2",                                             
                      ascending: true                                          
                    )                                                          
                  ),
                  logicalExpression: a!queryLogicalExpression(
                    operator: "AND",
                    filters: 
                    {
                      a!queryFilter(
                        field: "c4",                                                
                        operator: "in",                                             
                        value: local!reportUsers
                      ),
                      a!queryFilter(                                        
                        field: "c1",                                                
                        operator: "in",                                             
                        value: local!statusFilter,                                  
                        applyWhen: a!isNotNullOrEmpty(local!statusFilter)
                      )
                    }
                  )                                                            
                )
              )
            ),

Children