Inline script input in a custom FD action is missing from compiled snapshot if triggering user does not have role to write script


An action's inline script may be missing from the compiled snapshot if a user without one of the roles admin, scriptedit, or flow_designer_scripting is the first to trigger that action or trigger a flow calling that action.  This will happen for an action imported with an update set because such an action will need to be compiled to a snapshot the first time it is executed.  The error will not occur if a user with one of the roles mentioned above is the first to trigger and cause compilation of the action.

Steps to Reproduce

1. Import the attached update set which contains an action "DEF0165894_action" with a log step where the message is a inline script "return 'Hello world!';" and a flow "DEF0165894_flow" that calls the action.

2. Edit the user Abel Tuter and add roles sn_problem_read and sn_problem_wite. Alternatively create a new user with just those roles.

3. Impersonate Abel Tuter or other user without roles needed to create script (admin, scriptedit, or flow_designer_scripting).

4. Create problem with problem_statement = DEF0165894 to trigger the flow from the update set. The action is now compiled just-in-time as the user who triggered the flow who does not have the role needed to create script.

5. Go to the flow execution in the ops view and check the message input to the action log step. It is blank when expected to be "Hello world!".

Now that the action is compiled it will be missing the inline script for every user who triggers the flow no matter the roles. To fix the issue the action must be recompiled as a user with one of the roles needed to create script.


After importing an action, log in with a user that has at least one of the roles admin, scriptedit, or flow_designer_scripting and then open the action in flow designer and change something, undo your change and then publish it which will cause the snapshot to be compiled immediately.

Related Problem: PRB1444063