Hi there,
I want to validate a custom field right in the moment when the user clicks the "Save" button. There is no workflow transition involved, just a regular edit.
I tried to solve this with Scriptrunner's "Behaviours" functionality (which is awesome btw!), but here's the problem: I have a multi-select field where I have to validate that each value of this field is chosen only once over the whole project. Now this works fine right in the moment when the user chooses a value - I can catch that via the Behaviour and check, if that exact value is chosen anywhere else, and thus prevent saving by throwing an error. But think about this case: The user might have opened the Edit screen and have chosen a value like "Value 1". At this time "Value 1" was not chosen in any other issue. Now before he is clicking the Save-button (maybe she/he is away for a few minutes), somebody else does exactly the same thing with a different issue, but is saving right away. And when our user comes back and saves the issue finally, there is no error and we end up with two issues where "Value 1" is chosen, which we don't want in any case.
So can I validate sth. like a custom field right at the "Saving-Event"?
Thank you for any hints,
Alex