Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to add a validator to a workflow transition using groovy?

Samuel Holley January 5, 2024

Hi all,

Is it possible to add a validator to a workflow transition using a groovy script (for example, a custom REST endpoint)?

I can add the validator in the workflow editor as shown in the screenshot, I am wondering if this is possible to do via a groovy script.

The validator I want to add is to make the field required for the specific transition. I can make the field required/optional via groovy using the field configuration, but this affects every place where the field is used and I only want to make it required for a transition.

Capture.JPG

Replies appreciated, thank you

1 comment

Comment

Log in or Sign up to comment
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 5, 2024

Why are you trying to do this with a script?  It is going to take you a lot longer to write, test, and implement a script to edit your workflow than it is to do the handful of clicks you can use in the UI.  You are looking at writing hundreds of lines of code to do this.

TAGS
AUG Leaders

Atlassian Community Events