Best way to compare select list values using the JMWE App using a validator

Daniel Burris March 31, 2021

Hello,

I'm trying to find out the easiest way to create a validator that will compare the values of two select lists, single choice to ensure they don't have the same value.

I'd think something like this would work, but it doesnt work the way I'd expect it to.  I'm using JMWE for this.


issue.customfield_10619.value != issue.customfield_10620.value

 

1 comment

Comment

Log in or Sign up to comment
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.
April 1, 2021

Hi @Daniel Burris ,

in what way does it not behave as expected?

I can see a problem in the script, if any of the two fields has no value, but is there a problem beyond that?

Try this:

issue.customfield_10619 == null && issue.customfield_10620 != null
|| issue.customfield_10619 != null && issue.customfield_10620 == null
|| issue.customfield_10619 != null && issue.customfield_10620 != null && issue.customfield_10619.value != issue.customfield_10620.value
Daniel Burris April 6, 2021

This seemed to work. Thanks!

Mandy Sobel August 30, 2023

would any changes be needed if both fields were multi-select?

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.
August 30, 2023

Absolutely. The first question would be: would you want to check whether the two fields are identical, or whether the two fields share at least one value?

TAGS
AUG Leaders

Atlassian Community Events