lwhitelock/HuduAutomation

Wrong format for $job_fields

Closed this issue · 4 comments

The new format for custom_fields is with a single hash table.

“custom_fields”: [{
“brand”: “Apple”,
“model”: “MacBook Pro”,
“operating_system”: “Mac OSX”,
“notes”: “This computer is still being fixed.”
}]

Your MSP Backup example converts to JSON with multiple hashtables

“custom_fields”: [
{“brand”: “Apple”},
{“model”: “MacBook Pro”},
{“operating_system”: “Mac OSX”},
{“notes”: “This computer is still being fixed.”}
]

Ahh awesome thanks for that I had missed I was still wrapping them. Interestingly the API doesn't throw an error.

Its not updating assets fields still

Ok there is a nasty bug in Hudu itself. The script is working but when you now update asset fields, it is only tracking one set across all Assets of a type. So you set fields for one asset. Then update the fields on another asset in a different company of the same type. The first set of fields will be wiped and only the most recently updated version of the fields will be kept. This ends up with you only having fields on one asset of a type at a time. It looks like this is only when you update/create through the API.

They patched that this morning. The new API changes are working now.