Validate two fields when an issue is moved from open to in-progress

Abhishek Ramakrishna P February 27, 2023

Greetings to all!

I'm aiming to implement conditional validation whereby, upon transitioning an issue from "Open" to "In-progress", validation must occur to confirm that either the "component" field or the "sprint" field has been filled out. If either of these fields has not been filled out, the transition should not be allowed.

 

Can someone help me achieve this.

 

Thanks in Advance

2 answers

2 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 28, 2023

Hi @Abhishek Ramakrishna P 

should the transition be allowed if at least one of the fields has a value, or only if both fields have a value?

If the latter, then you can use a Field Required Validator.

If the former, you need to create a Build-your-own Validator with this Jira expression:

!!issue.components && issue.components.length > 0 || !!issue.sprint
Abhishek Ramakrishna P February 28, 2023

Thanks David, transition should be allowed if at least one of the fields has a value. proposed solution works as expected !

Rus Yates-Aylott
Contributor
September 12, 2024

A little late to the party here but I have used linked Conditions to evaluate responses to several fields. These are AND and OR conditions.

Since conditions do not through up any Validation error messages, I am looking to achieve the same thing using Validation rules. However, I cannot see how to chain AND validations and OR validations together using the standard offerings.

If, as I suspect, I have to write a simple script, so be it. But how do i do this within the Workflows editor?

0 votes
Answer accepted
Dave Mathijs
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 27, 2023

Hi @Abhishek Ramakrishna P 

On the transition from "Open" to "In-progress" you can add a:

Condition

  • Value fieldAllows to execute a transition if the given value of a field is equal to a constant value, or simply set.

OR

 

Validator

  • Field has single value Validator: Field must not be empty during the transition.

 

The difference is that with a condition, the transition is not visible until the fields are filled out (which may lead to confusion as to why one cannot transition from one status to another) whereas a validator allows you to indicate which fields are required and add a transition screen with those fields which allows your user to fill them out.

Abhishek Ramakrishna P February 27, 2023

Hello Dave, 

Thank you for the response. We did achieve this individually by adding condition & validator separately on the same transition,  I'm actually trying to find out can we achieve both at the same time as a validator by using ScriptRunner or JMWE for Jira cloud.

Regards,

Abhishek.

Like Dave Mathijs likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events