Jamf scripts run as root. You probably want your open command to run as the logged in user.
loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name
&& ! /loginwindow/ { print $3 }' )
su -l $loggedInUser -c "open /Applications/myapp.app/"
Another issue you're probably running into is that jamf login scripts are usually going to run before the user's login environment has fully loaded. Look into Launch Agents. Launch Agents load when the user environment loads.
This is really something that a LaunchAgent should be used for.
LaunchAgents & LaunchDaemons are important things to learn when it comes to macOS administration.
As such, have a look at: https://www.launchd.info