We have a groovy script in the Transition post function.
How do i make sure that the transition only goes through if the script executes successfully ?
As of now even if the script fails the transition goes through.
You don't.
A post-function can not stop a transition (well, they can if they fail catastrophically, but that can easily leave your issue data messed up too)
You need to move the script to a validator, but ideally only one that checks that the script will run ok when it's done as a post-function (you should not update anything in a validator, only check things)
Hi Nic,
Thank you for the response.
We are to create a Confluence page during a transition, we need to ensure that the transition is done only when the page is created and remote link is established.
Is there a way to check if a Confluence page creation groovy script will run okay ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is no way to do that in full, but what I would do is write a script that tries to read what the page will be in a validator - if it fails to open a connection to Confluence or finds the page (you can't create pages with the same name as an existing page, so this is a good check), then fail the validator.
If it passes, then try to create the page in the post-function, and capture the result. If you do get a failure, write more data back into the issue to tell the user the page failed to create!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.