How can I show all tasks attributed to a user from 3 separate process models?

I'd like to have a task report which shows all tasks attributed to a user from 3 separate process models.
I can achieve this by setting the task report to the context of a user and filter by pm_id's however I noticed that pm_ids are environment specific so when I migrate the report forward to test and prod environments, the pm_ids are unreliable.
Any suggestions?

OriginalPostID-228611

OriginalPostID-228611

  Discussion posts and replies are publicly visible

  • What is the Appian version you are using? If you are using a version of 7.8 or later, you can instead rely on constant of type ProcessModel.
    Create a multiple constant of type ProcessModel. Populate it with the process models you want to use as context. Then you can use tointeger and find out process model ids. The process model ids will be correctly resolved even if you move to another environment
  • The latest 16.2 if I want to a task report though I need to set up a Portal Report - this doesnt allow the use of expressions when setting up the pm_id filter?
  • @jarrods If the Appian version is 7.7 or earlier, you may do something like this: Use the process model UUIDs and get the Id based on the UUID and for this you may rely on the "Content Details by UUID" plugin at https://forum.appian.com/suite/tempo/records/item/lIBCLGOdlMUpdGVqW3dQaIKmclBmvvNEj8vu_cjb7T-5YiPr4Fu8ly5Yj1s09uenE4RYzA8zKyx7eiUjehE6c4co9Y9YmYyXyje4cU5tvLsZq51/view/summary. So you should basically build a helper rule that gets the Process Model Id when a Process Model UUID is sent as an input to it and this will relieve you from the burden of changing the Process Model Ids across the environments.
  • @jarrods Then you can opt for the approach as suggested by @chetany.

    If your intention is to apply the filter while querying the Portal Report data, then add a column in your report with value as pm!id. In the filters of the a!queryProcessAnalyics(), you may add a filter on the newly added column(that has pm!id as value) as follows:
    a!queryFilter(field: "c5", operator: "in", value: fn!tointeger(cons!MY_PROCESS_MODEL_LIST))
    Documentation at https://forum.appian.com/suite/help/16.2/Task_Report_Tutorial.html (https://forum.appian.com/suite/help/16.2/Task_Report_Tutorial.html#Add_a_Predefined_Filter in particular) should be a good reference for you.

    If your intention is to apply the filter in the Portal Report itself, then add a column(let's call it as 'isTaskFromDesiredProcessModel') of type Boolean in your report with value as fn!contains(fn!tointeger(cons!MY_PROCESS_MODEL_LIST),pm!id). Then in the 'Filters' tab of the Process Report, add a filter on the newly added column as shown below: isTaskFromDesiredProcessModel = true.
    In this case, documentation at https://forum.appian.com/suite/help/16.2/Adding_Filters_to_Reports.html should act as a good reference.

    Please do let us know if you have any follow-up questions.
  • Perfect - thats what I need (the queryfilter on the processanalytics)
  • We had a similar use case and we used a process report in the context of process models (list of process models defined through constant). Then added an additional filter which filters the column that has tp!assignees (either group or user) as value. The filter will be like a!queryFilter(field: "c5", operator: "in", value: {loggedInUser(), getgroupsfromemberuser(loggedInUser())}

    This brings tasks in the context of set of process models and filters the tasks assigned to current user and to all groups, the current user is part of.

    We went with this approach since we want to reuse the same process report in a record summary dashboard where user needs to see all active tasks for that particular entity irrespective of whom the task is assigned to. Kind of an admin person to see where are all the tasks (of the same list of process models) are currently residing with and their deadline. So by just removing the additional filters we get the desired result here.

    Just thought of sharing this use case.