Skip to main content
ramkumaru0002
October 17, 2022
Question

Unable to query Process Report in a process instance started via WebAPI

  • October 17, 2022
  • 4 replies
  • 0 views

Hi All,

We've a process which is started via webAPI and has a node which uses QueryProcessAnalytics to query the process report to get a few details. This node where it fetches the data from Process Report is  not working/not returning results when running the node as the same user as process initiator(in this case , service account used by webAPI), however, it works fine when changing to execute as user (process designer). We checked the security of the process reports and the parent folder and it has the service account group with Viewer permission.  The only difference we see is the service account is basic user and the process designer user is system administrator. Any pointers to why query process analytics is not working when called via webAPI with a service account?

4 replies

harshitb6843
October 17, 2022

By any chance, have you used loggedInUser() anywhere in your script task or expression rule? Appian returns Appian Administrator when we use this function inside a process. If yes, then you will have to create an Ri and pass pp!initiator in that variable. 

ramkumaru0002
October 17, 2022

Hi Harshit, Thanks for reply, we've not used loggedInuser in the script task, the script task only contains rule GBL_queryProcessAnalytics with the query parameter input and no user id is passed explicitly while invoking the rule.

stefanhelzle0001
October 17, 2022

This is a permission problem. The user calling the API has to have access to all used objects. That includes the process instances that report show display.

ramkumaru0002
October 17, 2022

Thanks Stefan, Was able to figure out as one the process model used in reporting was still having initiator permission to the process instead of viewer