Patch Reporting & Scripting

davec
New Contributor III

Is there a way of passing the "Latest Version" variable from Patch Reporting of an application into a script in a policy?

 

Thanks

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor III

Ok, I was mistaken. The URL is still active. It's just that they seem to still have a lot of older titles in it that show up way at the top with some old last modification dates, like going back to 2020. But searching through the output, I can see the latest version of Google Chrome in there, as an example.

 

 

 

{
   "name": "Google Chrome",
   "publisher": "Google",
   "lastModified": "2023-10-11T06:43:20Z",
   "currentVersion": "118.0.5993.70",
   "id": "0BC"
},

 

 

 

That's just from 2 days ago, so it's current.

The URL is https://jamf-patch.jamfcloud.com/v1/software

Here's an example of how I might pull the latest version of Chrome. Back in the day I might have used a call to pass the output into python to get the specific information, but with python being removed from the macOS, it doesn't make much sense to use that anymore.

 

 

 

curl -s https://jamf-patch.jamfcloud.com/v1/software | grep -A4 "Google Chrome" | awk -F'"' '/currentVersion/{print $4}'

 

View solution in original post

5 REPLIES 5

AJPinto
Honored Contributor III

Unfortunately no. However, you can make an extension attribute and a smart group to work with a policy in the same way patch management works.

davec
New Contributor III

Thanks. 

I was thinking of a Self Service option to download (curl) app installers/dmgs where the file name has the version number on it.  It would be easy if I could just pass the variable into the script's parameter. 

mm2270
Legendary Contributor III

At one time there was a public URL that Jamf maintained that had all their patch titles and details (like latest version, etc) in a JSON format. That could be curl'd in a script to grab the information you're looking for. Sadly, it looks like Jamf moved on some time ago to a different method. That URL still exists, but based on the last modification dates I see in it, they haven't been touched in several years now.

You could reach out to Jamf to see if there is some new URL they are using for this now that can be accessed. I have a feeling it's now protected for security reasons and no longer readable in a regular script though.

mm2270
Legendary Contributor III

Ok, I was mistaken. The URL is still active. It's just that they seem to still have a lot of older titles in it that show up way at the top with some old last modification dates, like going back to 2020. But searching through the output, I can see the latest version of Google Chrome in there, as an example.

 

 

 

{
   "name": "Google Chrome",
   "publisher": "Google",
   "lastModified": "2023-10-11T06:43:20Z",
   "currentVersion": "118.0.5993.70",
   "id": "0BC"
},

 

 

 

That's just from 2 days ago, so it's current.

The URL is https://jamf-patch.jamfcloud.com/v1/software

Here's an example of how I might pull the latest version of Chrome. Back in the day I might have used a call to pass the output into python to get the specific information, but with python being removed from the macOS, it doesn't make much sense to use that anymore.

 

 

 

curl -s https://jamf-patch.jamfcloud.com/v1/software | grep -A4 "Google Chrome" | awk -F'"' '/currentVersion/{print $4}'

 

davec
New Contributor III

Thanks!  This will certainly make my life easier.  The weird thing is when I go to the site and do a find (command-f) for one of the apps, say "Google Chrome" it won't find it but does find it when running the curl command.  Same with a few others I had tried like Figma and Audacity.