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)
Discover how Atlassian is revolutionizing service management with cutting-edge solutions for AI-powered support, HR Service Management, or DevOps connectivity.
Register here ⬇️Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.