I did not find an example for how to update a specific field in a specific entity in Button/Action scripts.
Is there a fibery.apiFunction for this, or do we need to use fibery.executeSingleCommand / POST ?
Actually, what I need to do is update a “to-one” relation field. So that could mean removing the existing linked entity (if any), and then link a new entity.
If I’m understanding correctly, I believe in this case you’d just set the field name to the entity id. So, if you had a Story->(1) Project relationship. To change the project the Story is assigned to, you’d just overwrite the Story’s “Project” attribute with the id of the project you want to change the relationship to.
There is an example script where they are creating entities and assigning entity ids. Assigning a new relationship is the same as overwriting one.
If the relationship is a collection, there is a specific method fibery.addCollectionItem and fibery.removeCollectionItem available.