Forums

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

Conditional Validator for Jira Cloud for text field Multiselect field

Suresh Bhandiwad
Contributor
March 30, 2025

Greetings Team,

We have a Multiselect field with value option 'Create' and a Multiline text field. I am setting Multiline text field as required when value on Multiselect field choosed as 'Create'. I was able to get it working on behaviours only when new transition option is enabled on profile setting which is downside as educate this enabled to end users is being challenge.

So, I am looking to get this using workflow validators using scriptrunner for Jira cloud using Jira expression. However, expression is able to validate only text field not the multiselect field.

Tried with below expression, sets text field as required in all scenarios

let plainTextValue = value => typeof value == 'Map' ? new RichText(value).plainText : value ; issue.customfield_13622.value == 'Create' ? plainTextValue(issue.customfield_13272 != null) && plainTextValue(issue.customfield_13272) != '' : true

Below one, doesn't recognize the value on the text field and sets as required even we have text entered, with select value as Create

issue.customfield_13622 == null || (issue.customfield_13622.value == 'Create' && (plainTextValue(issue.customfield_13272 != null) && plainTextValue(issue.customfield_13272) != '')) 
//customfield_13622 = Multiselect field with value 'Create'
//customfield_13272 = Multiline text field

 

Any help would be appreciated.

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 31, 2025

Hi @Suresh Bhandiwad

In your description, you mentioned:

I am setting Multiline text field as required when value on Multiselect field choosed as 'Create'. I was able to get it working on behaviours only when new transition option is enabled on profile setting which is downside as educate this enabled to end users is being challenge.

So, I am looking to get this using workflow validators using scriptrunner for Jira cloud using Jira expression. However, expression is able to validate only text field not the multiselect field.

Setting a field to required is only doable via Behaviour.

You could however use the Validator to return an error message if the field value is not included. Something like:-

issue.customfield_13622 != null

I hope this helps to solve your question. :-)

Thank you and Kind regards,
Ram

Suggest an answer

Log in or Sign up to answer