Forums

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

Need dynamic error message for JMWE Validation

PLaksh11
Contributor
June 25, 2025

Hi Everyone,

We have a 3 drop down custom fields with same values. When user selects same values more than one custom field then it should throw the error.

Ex: Custom field A, B and C(all 3 are Drop downs)

If user selects, Apple and orange in custom field A

                             Orange and Mango in custom field B

                             Banana and Apple in custom field C

In above scenario, Apple and orange are selected more than once. Hence, we are expecting the error message like this. Apple and orange are selected more than once hence remove it to avoid duplication.

currently we are able to achieve this with below Jira expression using JMWE Build your own Validator. But only drawback is we cant able to customized the error message. 

let field1 = issue.customfield_15461 ? issue.customfield_15461.map(val => val.value) : [];
let field2 = issue.customfield_15575 ? issue.customfield_15575.map(val => val.value) : [];
let field3 = issue.customfield_15576 ? issue.customfield_15576.map(val => val.value) : [];
!field1.some(val => field2.includes(val) || field3.includes(val)) && !field2.some(val => field3.includes(val))

Serial Number should not be repeated for multiple disposition types(Asset for Maintenance, Asset for BtNc and Asset for DCC).Please check and remove the duplicate Serial Number

If user selected more than 10 times from each custom field then it will be difficult for him to check which item is selected more than once. 

Hence we need to clearly inform them this particular items are repeated or selected more than once.

 

Thanks

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Oleksii Melnyk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 25, 2025

I'm afraid according to the official documentation from Appfire, JMWE does not support this functionality.

https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466226183/Build-your-own+scripted+Validator

PLaksh11
Contributor
June 25, 2025

@Oleksii Melnyk Thanks for the reply. But is there any way that we can achieve?

 

Thanks,

Oleksii Melnyk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 25, 2025

Only if you can split one validator into several (one for each situation) and add the appropriate error to each one

Like PLaksh11 likes this
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events