Set the attribute value based on the work item state
One answer
No, there is no out of the box precondition for this. It is not possible to do this with preconditions as the API interface assumes that a precondition does not modify the triggering element it works on.
You can create a follow up action or participant to do this. It can detect state changes and force an additional save operation. See examples here: https://rsjazz.wordpress.com/?s=participants
Theoretically you could probably use a JavaScript based value provider, however it is so hard to detect a state change there, that you would need additional hidden attributes and I would not suggest this path.
To learn about extending follow the suggested links in the posts https://rsjazz.wordpress.com/?s=participants
You can create a follow up action or participant to do this. It can detect state changes and force an additional save operation. See examples here: https://rsjazz.wordpress.com/?s=participants
Theoretically you could probably use a JavaScript based value provider, however it is so hard to detect a state change there, that you would need additional hidden attributes and I would not suggest this path.
To learn about extending follow the suggested links in the posts https://rsjazz.wordpress.com/?s=participants