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
I assume you use a process report to show these tasks. How is this configured? And how do you filter the query?
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) ) } ) ) ) ),
When configuring the process report, do you see the tasks as expected?
Yes, if I open up the report I can see all statuses on the tasks. Including "Assigned"..
OK. Then try to remove the queryFilters and see what happens. Remove complexity, understand the effect of the changes.
Ah, the process report has the User field empty on all tasks with the status "Assigned".. Do you know why this happens? Is this some sort of common thing for appian?
Depends on the attribute you use in the process report for this field. Do you want to share that?
Yes, I'm using the tp!owner attribute for that field and it's empty on all tasks with the status "Assigned". Am I supposed to use some other attribute?
If possible could you please share process report snapshot along with definition of c4 and c1.
Yes. tp!owner is the attribute populated as the user accepts a task.
Use fn!task_assignee_owner() instead.
Find these functions here