Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Script Validator

Harsh
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.
September 26, 2023

Hi Community,

I am facing a challenge. 
I have 2 projects - Project A and Project B.

Project A workflow looks like - Open -> Review -> In Progress -> End

Project B workflow looks like Open -> End
Project B edit screen has customfield_1 customfield_123

When in Project A - It goes from Open -> Review
It creates a ticket in PROJECT B of type task, with summary as Summary-XYZ

Similarly, when goes from Review  -> In Progress
It creates a ticket in PROJECT B of type task, but with summary as Summary-ABC.

I want a validator in Project B workflow to allow End transition only if the customfield_1 and customfield_123 is filled but only when the Summary-ABC and not for other. Also is it possible to Hide these custom fields when summary is XYZ.

Is this achievable via scripting/behavior?

Appreciate the help!

1 answer

1 accepted

1 vote
Answer accepted
Jeff Tillett
Community Champion
October 5, 2023

Yes this is possible via scripting/behavior when using the Scriptrunner plugin. You will want to use "behaviors" for hiding the custom fields based on a regex value (you can base it on anything, but I am suggesting regex based on the info provided so far).

For the validator, you can also do this as a scripted validator by writing a groovy script to check the value of those custom fields and ensure they are returning a truthy value. This might be easier with JMWE than Scriptrunner due to the drop downs in their UI, plus their self help documentation and their test functionality from the workflow designer. 

Suggest an answer

Log in or Sign up to answer