I'm trying to understand the use of this Payload, because there is no actually description (with examples) in Jamf admin guide.
Here is the scenario that I'm trying to follow:
Can anyone please explain, because I have a feeling that I'm missing something in here, because I don't know where is the "IF" condition in this whole scenario, in order to trigger the event to install that app?
The "logic" is going to be handled by scoping, or more explicitly with scripts if you want to add more complexity.
If all you want to do is install an app for systems that don't have it, you can just have a policy scoped to a smart group of systems that do not have that app installed, and the policy's only payload would be to install it. The scope would provide that "If" element.
With scripts and event triggers you can expand on this, but that's the simple version I'd start with.
The title of your discussion seemed to fit, not trying to hijack
It states that commands run as root user so would you still need to use sudo?
"sudo jamf flushPolicyHistory"
or would just "jamf flushPolicyHistory" be the proper way to do it?