Executing this script requires a username with access to the JSS API. Users can be given access by going to Settings->Accounts->Edit Account->API Privileges tab and granting permissions.
Before executing, update the script to include the correct JSS API username, JSS API password, and the JSS URL (without the trailing slash)
This script copies an iOS device's hostname from the JSS and submits it into the device's inventory record under Location->Room. Organizations utilizing an Asset Tag can set the hostname of the device to the asset tag, then copy the hostname to the Location field for future searches, reporting, etc.