Groovy Script: Copy Data Item value to Asset Property value

This Groovy script takes any dataitem values and writes them to properties of the same name - if they exist. The rule to call this script needs to be a data trigger such as:

If: some condition
Then: ExecuteCustomObject("CopyParameters")

The script uses the default context that contains an asset (device) and the default parameter dataItems that contains the current reported dataitems (from an agent)