I've written a ScriptRunner Listener to update several fields in an issue when the Epic Link field on an issue is changed.
My listener is triggered by the IssueLinkCreatedEvent — and the code works fine. (Note that as far as I could tell, the Issue Updated event does not contain any information about the Epic Link field being updated.)
But here's the problem:
When a user goes into Edit mode and they update the Epic Link field and save their changes, the listener gets triggered, it updates the issue, but then Jira overwrites the changes the listener made back to the values they were when the user was editing the issue.
This is apparent when you look at the History for the issue:

❶ The Listener triggers first, and properly updates Fix Version/s from "none" to "1.2".
❷ Jira updates the issue and records the change to the Epic Link field
❸ Fix Version/s is reverted back to "none" 😞
As a workaround, I considered adding a Behaviour to the Epic Link field to manually update the fields on the Edit form, but there are downsides to doing that, not the least of which is that adding a Behaviour disables the ability to do the quick inline edit of the Epic Link field (clicking the pencil takes you to the full Edit screen), plus it makes the field inaccessible from the dot (.) menu to quickly modify the Epic Link field using the keyboard.
Using a Listener is the best approach, since it handles other situations where the Epic Link can be updated, such as when issues get dragged-and-dropped on an Epic on a Jira Scrum board.
Has anybody experienced this before? Is there something else going on that I'm missing?