It is possible to track quantity of an asset with post functions. Please follow the steps of the following example.
In this example, we'll demonstrate to decrease quantity value of an asset which is attached to a Jira issue on Done workflow transition.
1- Define a Quantity attribute
2- Add it to the desired form
3- Create an asset and set a Quantity value (i.e 50)
4- Now there is an asset with a Quantity value 50
5- Define the post function to update quantity
Select Add "[AIP] - Update Asset workflow postfunction" to the workflows to update an asset object on transition. And select Quantity field. Leave form parameter as blank to set any matching form.
Post function Groovy Script
aipUtils.getAttributeValueAsStringByName returns the Quantity attribute value of the asset.
"return null" result won't update asset. If you want to clear attribute value use "return ''"
6- Test it on Post Function Create Screen and publish workflow
7- Change status of the Issue to execute post function.
In this example post function is configured to for Done transition. Quantity is set from 50 to 49.