Skip to main content
October 14, 2022
Question

How to query "Assigned to" tasks from a Process Report?

  • October 14, 2022
  • 1 reply
  • 0 views

Hi Community,

I am trying to query form Active Task assigned to users in my application from a Process report. I was not able to create a filter for the same to check assigned tasks for selected users.

= a!queryProcessAnalytics(
  report: cons!I_MY_OPEN_TASKS,
  query: a!query(
    logicalExpression: a!queryLogicalExpression(
      operator: "AND",
      filters: {
        a!queryFilter(
          field: "c0",
          operator: "includes",
          value: ri!taskName
        ),
        a!queryFilter(
          field: "c3",
          operator: "between",
          value: {
            ri!assignedOnFrom,
            a!defaultValue(ri!assignedOnTo, today())
          }
        ),
        a!queryFilter(
          field: "c4",
          operator: "in",
          value: ri!assignedTo /*issue at this filter*/
        )
      },
      ignorefilterswithemptyvalues: true()
    ),
    pagingInfo: a!defaultValue(
      ri!pagingInfo,
      a!pagingInfo(
        startIndex: 1,
        batchSize: - 1,
        sort: a!sortInfo(field: "c3", ascending: false)
      )
    )
  ),
  
)
  

In the above code "c4" is "Assigned to" column in my report which contains single user/multiple users/ user groups.
I have attached the rule input screenshot as well.


If I enter the email/username of the user I am able to see the tasks, but it won't show the tasks which have multiple users assigned.
Please suggest how can we filter the tasks by "assigned to" column.
  

1 reply

stefanhelzle0001
October 14, 2022

If you try to display tasks assigned to a user from a specific set of process models, I suggest to create that report the other way around. Start with "Tasks for user" and then filter by process models using a constant with a list of the models.