jamf flushPolicyHistory for specific policy?

New Contributor III
New Contributor III

Is it possible to flush the policy history of a particular policy from the client?

Something like

[code]jamf flushPolicyHistory -id 217[/code]


Just wondering, and thinking it might be handy when testing...


Honored Contributor

AFAIK, it flushes a machine's entire policy history. Still useful, but something more granular would be nice. Sounds like a Feature Request :)

Valued Contributor II

Not sure if this helps or if you're only looking for something at command line, but you can wipe policy history for just one policy on one computer via console.
View status of policy, view log, flush history for this policy/computer

-- edit sorry just saw you mention from the client.

New Contributor III
New Contributor III

@jarednichols - yes, flushing the entire policy history is much too broad, but it would be useful to be able to do it for a specific policy and machine.

@CasperSally - yes, this is from the client (on the command line). But since it can be done from the JSS web interface, the functionality is clearly there, it just needs to be made available via the jamf binary.

I guess I'll file a feature request.

BTW - one example of usage: An application has a Self Service installer and uninstaller, with the Installer having an execution frequency of 'once per computer'. The uninstaller could then flush the Installer policy history for that computer, making the Installer available again after the uninstaller runs.

Legendary Contributor III

I agree being able to flush a single policy via CLI or script would be super useful. But, robo, in the example you point out, you can handle this through the use of Smart Groups. Example. make a Smart group for Macs with Application Title | does not have | appX. Then set your policy to "Ongoing" instead of "Once per Computer".
If the user uninstalls the app, or runs an uninstall self service policy, etc. once the Mac re-inventories, it will fall into the above Smart Group, scoped to the policy and it shows up again for them.
While the above does mean more work in creating those Smart Groups, it does work and is partly how Casper was designed to work.
Still, put in that Feature Request, because its valid. There are definitely going to be uses for it.

Contributor II

Has this ever been implemented?

I have an similar situtation as @robo


Contributor III

Nope, but Under Review: https://jamfnation.jamfsoftware.com/featureRequest.html?id=973


@pete_c Somehow in the last 4 years https://jamfnation.jamfsoftware.com/featureRequest.html?id=973 has disappeared. Does anyone know if this feature ever got added? The binary's help command still only has this to say:
jamf help flushPolicyHistory
Usage: jamf flushPolicyHistory
Doesn't mention any switches for specifying a particular policy. Anyone know where this is at?
- Scott


@robo , how did you deal with it? Di you adopt @mm2270 's method?

New Contributor III

  I wanna bring this back up because I need this now.  I ran a policy to like 300 machines.  Turns out I made a typo in the script and now they all have a policy log for a broken script.  I would like to simply make all machines in this group forget the fact that they got it once and try again.  I'd rather not flush this one policy on each machine individually, nor do I want to flush all policies for all machines.

New Contributor III

Nevermind....I got it.

New Contributor

For a single policy? Care to share?

New Contributor III

My bad you guys.  All I did was fix the script and set the policy frequency to ongoing with a custom trigger.   I then sent a remote command (sudo Jamf policy -event CUSTOMTRIGGERNAMEHERE) to that smart group to run it again.