...
def orderAmountCustomFieldId = 'customfield_10316'; // set the id according to your environment
Test
Asset had 20 "number Number of items in stock" , after "Done" transition, it became is increased from 20 to 32.
Also Stock is reflected to Yes. If the same transition passes, post function will not update asset.