fieldsHaveSameValue(jql-subquery, field-name1, field-name2,...,field-name-x)
FieldsHaveSameValue can be used to find issues with fields having the same value. For instance:
issue in fieldsHaveSameValue("version", "my-custom-field-with-version")
It is possible to use multiple fields in the expression, such as below:
issue in fieldsHaveSameValue("version", "my-custom-field-with-version", "one-more-field-with-version")
It is also possible to add JQL subquery to the expression. It will narrow the search only to those issues which match the subquery (in the example below, are in the project DEMO and have the same value of fields version and my-custom-field-with-version).
issue in fieldsHaveSameValue("project = SEARCH", "version", "my-custom-field-with-version")
In case fields contain multiple values (for instance, there are many values of field version) the function will expect all values to be equal (but doesn't expect the same order).