Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,000
Community Members
 
Community Events
168
Community Groups

How to prevent issue transfer in postfunction

Edited

How to prevent problem transfer in postfunction
Hello, my current jira environment uses the ScriptRunner plugin, and I have such a request.
I want to add a custom script fragment to the post function of the workflow, when something does not conform to the flow, throw an exception and prevent the problem state from changing.
What should I do please?

1 answer

1 accepted

1 vote
Answer accepted

You do not do this in a post-function.  Post-functions run at the end of a transition, after you've decided you're going to commit to it, it is too late to change your mind about doing it.  Imagine you're going sky-diving - a post-function would be "open parachute" as you're on your way down, not "decide not to jump".

You need a validator - these check the data the user enters into the transition screen, and the current data on the issue and returns the user to the transition screen if the data fails your checks.  (You might also look at a condition - these stop people from clicking on a transition if the data doesn't match your rules)

There are some examples of validators at https://library.adaptavist.com/search?page=1&products=jira&term=validator

Suggest an answer

Log in or Sign up to answer