Software Updates field

ifbell
Contributor

I have been trying to find an answer to this question but alas I am unable to through various search permutations. Is there a way to pull the information out of the Software Update field in the User inventory? I am looking fo an API call or a smart group anyway I can use the information in that user inventory field.

4 REPLIES 4

mjerome
New Contributor II

following.

JustDeWon
Contributor III

Not seeing a way for that particular field. However, you may be able to create an EA utilizing the softwareupdate -l command, getting the results then you should be able to pull info from that EA field.

mm2270
Legendary Contributor III

If you're referring to this section in a computer record:

85835f2ea30940ab8dc2e6eeaa1cfa08

That shows items like this:

789dbfcf119040bdaadedd80031b3bf3

Then that is available in each computer record's API info. It's listed under the software section, in a sub section called available_software_updates

Example code to get it with the API:

curl -H "Accept: application/xml" -sfku apiuser:apipass https://your.jamfpro.url/JSSResource/computers/serialnumber/<serialnumber> | xpath '/computer/software/available_software_updates/name/text()'

I'm not sure how the above works when there are multiple updates available. I don't currently have a machine on hand that needs several updates so I don't have a way to test that. But give that a try against an existing system on your end and see how it works.

mm2270
Legendary Contributor III

BTW, technically this is also available for Smart Groups. You can use the "Available Software Updates" or "Available SWUs" criteria and plug something in there to gather machines that have certain updates showing.
Unfortunately, that criteria item doesn't seem to take any regex matching. It has to be an exact string. At least in my brief tests I wasn't able to get it to show any Mac that had a "macOS Update" available, regardless of the version by using a regex pattern.

There is also a "Number of available updates" item for Smart Groups too, that would take an integer value. It can use greater than/less than modifiers.