I've written an Insight Post Function that, when an exception is encountered, updates a custom field with the error information and returns false. The custom field is so that the user is aware of the problem. I had it return false on the (bad) assumption that this would block the transition from continuing.
I just modified the code to throw a new exception instead of returning false, but that doesn't block the transition either.
Is there any way for a post function to prevent a transition from reaching its target status? For example, is there a jira field associated with the transition that I can set to false?
No. A post-function is too late to block a transition, the only way to halt it in a post-function is to crash out, which can leave the data broken.
If you need to do things in a post-function that might fail, then do them, catch the error and let the transition complete, but put something on the issue to say "this failed - remote data is now wrong" (and if you've got an automation/scripting add-on, code something to either move the issue back, or repeat the remote update repeatedly until it works, maybe)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.